I want my app to run only on landscape orientation, so I have added android:screenOrientation="landscape"
in every activity in the manifest.
But surprisingly I'm getting so many crashes in Crashlytics and it's showing in the data that the crash occurs while the device is in a portrait mode (how come it's on a prorate mode).
the crash says
Caused by android.content.res.Resources$NotFoundException
Resource ID #0x7f0a001e
android.content.res.Resources.getValue (Resources.java:2327)
android.content.res.Resources.loadXmlResourceParser (Resources.java:3692)
android.content.res.Resources.getLayout (Resources.java:2143)
android.view.LayoutInflater.inflate (LayoutInflater.java:396)
android.view.LayoutInflater.inflate (LayoutInflater.java:354)
android.support.v7.app.AppCompatDelegateImplV9.setContentView (AppCompatDelegateImplV9.java:287)
android.support.v7.app.AppCompatActivity.setContentView (AppCompatActivity.java:139)
com.xx.xxx.Activity.onCreate (Activity.java:42)
android.app.Activity.performCreate (Activity.java:5447)
android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1094)
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2393)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2493)
android.app.ActivityThread.handleRelaunchActivity (ActivityThread.java:4014)
android.app.ActivityThread.access$900 (ActivityThread.java:166)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1289)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:136)
android.app.ActivityThread.main (ActivityThread.java:5584)
java.lang.reflect.Method.invokeNative (Method.java)
java.lang.reflect.Method.invoke (Method.java:515)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1268)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1084)
dalvik.system.NativeStart.main (NativeStart.java)
and this is my onCreate method @Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(((AppTheme)getApplicationContext()).getCurrentTheme());
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_layout);
ButterKnife.bind(this);
presenter = new Presenter(this);
setupPages();
enterImmersiveMode();
}
I'm wondering how it's recorded on Crashlytics that the crash occurs when the device is on portrait mode . so I guess that when it's on portrait mode it can't get the layout cuz all the layout in (layout-land) not in the layout folder.