Note that there are some explanatory texts on larger screens.

plurals
  1. PO"requestFeature() must be called before adding content" master detail template
    text
    copied!<p>I started a new app with the master detail template.</p> <p>When I try the app on my tablet, using the two-pane layout, it crashes with the exception in the title when I change orientation of the tablet. This happens only if the detail fragment has content.</p> <p>The crash is in <code>super.onCreate</code> line, I'm not even calling <code>requestFeature</code>, so it's not even my code:</p> <pre><code>@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_item_list); if (findViewById(R.id.item_detail_container) != null) { // The detail container view will be present only in the // large-screen layouts (res/values-large and // res/values-sw600dp). If this view is present, then the // activity should be in two-pane mode. mTwoPane = true; // In two-pane mode, list items should be given the // 'activated' state when touched. ((ItemListFragment) getSupportFragmentManager().findFragmentById( R.id.item_list)).setActivateOnItemClick(true); } } </code></pre> <p>Stack trace:</p> <pre><code> 12-14 23:18:44.716: E/AndroidRuntime(32065): FATAL EXCEPTION: main 12-14 23:18:44.716: E/AndroidRuntime(32065): Process: com.manor.barcam, PID: 32065 12-14 23:18:44.716: E/AndroidRuntime(32065): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.manor.barcam/com.manor.barcam.ItemListActivity}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195) 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3738) 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.app.ActivityThread.access$900(ActivityThread.java:135) 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1202) 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.os.Handler.dispatchMessage(Handler.java:102) 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.os.Looper.loop(Looper.java:136) 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.app.ActivityThread.main(ActivityThread.java:5017) 12-14 23:18:44.716: E/AndroidRuntime(32065): at java.lang.reflect.Method.invokeNative(Native Method) 12-14 23:18:44.716: E/AndroidRuntime(32065): at java.lang.reflect.Method.invoke(Method.java:515) 12-14 23:18:44.716: E/AndroidRuntime(32065): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 12-14 23:18:44.716: E/AndroidRuntime(32065): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 12-14 23:18:44.716: E/AndroidRuntime(32065): at dalvik.system.NativeStart.main(Native Method) 12-14 23:18:44.716: E/AndroidRuntime(32065): Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding content 12-14 23:18:44.716: E/AndroidRuntime(32065): at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:249) 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.app.Activity.requestWindowFeature(Activity.java:3298) 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:63) 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98) 12-14 23:18:44.716: E/AndroidRuntime(32065): at com.manor.barcam.ItemListActivity.onCreate(ItemListActivity.java:54) 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.app.Activity.performCreate(Activity.java:5231) 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 12-14 23:18:44.716: E/AndroidRuntime(32065): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) 12-14 23:18:44.716: E/AndroidRuntime(32065): ... 12 more </code></pre> <p>How can I solve it?</p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload