`
xp9802
  • 浏览: 1202162 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

must be called before adding content异常处理

 
阅读更多

关于以下异常的解决办法

 

Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding content

今天根据教程写了一个例子,就是调用android中的android.hardware.Camera来完成拍照功能,但是遇到这么一个异常。

setContentView(R.layout.main);

  requestWindowFeature(Window.FEATURE_NO_TITLE); 

 

我是这么写的,结果抛异常了,解决方法如下:

  requestWindowFeature(Window.FEATURE_NO_TITLE); 

 setContentView(R.layout.main);

嗯,顺序换一下就好

分享到:
评论

相关推荐

    go-sitemap-generator:go-sitemap-generator是在Go中生成Sitemap的最简单方法

    // Create method must be called first before adding entries to // the sitemap. sm . Create () sm . Add (stm. URL {{ "loc" , "home" }, { "changefreq" , "always" }, { "mobile" , true }}) sm . Add ...

    VclZip pro v3.10.1

    This will cause files to not be decryptable by normal zip utilities thereby adding a bit of extra security. Bugs Fixed: IMPORTANT!!! Behavior of freeing the ArchiveStream (compressed stream) has ...

    数位板压力测试

    The device must have a point-ing ap¬para¬tus or method (such as a stylus, or a finger touching a touch pad), called the cursor, that de¬fines the current position. The cursor must be able to ...

    a project model for the FreeBSD Project.7z

    This is synonymous with deliverable, that is defined as “any measurable, tangible, verifiable outcome, result or item that must be produced to complete a project or part of a project. Often used ...

    IOS5 Programming Cookbook

    - **Error Handling**: Compilation errors are common and must be addressed before your app can run. Common issues include syntax errors, missing imports, and type mismatches. ### 4. Running iOS Apps ...

    NewSID(光学习一下代码就可以了,没看清楚介绍别运行)

    Note that just changing the computer name or adding the computer to a different domain does not change the computer SID and that the computer SID is not the same as the SID, called the domain SID, ...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    Returns True if the string must be enclosed in quotes (flex-property value) before saving in the filer. - ADD: In the class TFlexGrid added the methods DoSnap and DoCustomSnap (the last one can be ...

    Java邮件开发Fundamentals of the JavaMail API

    Before looking into the JavaMail API specifics, let's step back and take a look at the protocols used with the API. There are basically four that you'll come to know and love: * SMTP * POP * IMAP...

    ICS delphixe10源码版

    must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. 4. You must register this software by sending a picture ...

    django-master-class

    - **Tag Registration:** Custom tags must be registered in a template tag library using the `register` object. - **Common Use Cases:** - Displaying paginated content. - Generating navigation menus ...

    php.ini-development

    Note: output_handler must be empty if this is set 'On' !!!! ; Instead you must use zlib.output_handler. ; http://php.net/output-handler ;output_handler = ; Transparent output compression using the ...

    .htaccess

    <br>You can use custom error pages for any error as long as you know its number (like 404 for page not found) by adding the following to your .htaccess file: 你所知道的任何页面错误代码(像404找...

    VB编程资源大全(英文源码 控件)

    <END><br>10 , Scroller.zip This is a Control Container, it's like a frame control but it lets you scroll the content up and down...<END><br>11 , TrayArea.zip This control lets you add your icon ...

    Delphi7.1 Update

    breaking information not included in this readme file.IMPORTANT: Delphi must be closed before installing this update. =====================================================CONTENTS * INSTALLING THIS ...

    四级完形填空词组总结

    - **例句**:We must fight against discrimination and injustice. (我们必须与歧视和不公正作斗争。) #### 42. fight with 与……战斗 - **例句**:Soldiers fought with courage in the battle. (士兵们在战斗中...

    ViewPager 放大缩小左右移动

    * Called when the scroll state changes. Useful for discovering when the * user begins dragging, when the pager is automatically settling to the * current page, or when it is fully stopped/...

Global site tag (gtag.js) - Google Analytics