0

I have an Activity A which is displayed in Portrait mode only, which will call an Activity B which can be displayed in Portrait or Landscape Mode.

If I open the activity B on Portrait Mode, and rotate the device, everything is displayed as expected. If I am on Activity A and rotate the device for Landscape Mode, the Activity A keeps its orientation (as expected), but the Activity B then is called and does not call onConfigurationChanged() (which i have my logic to display things in a different way).

In Manifest im already setting:

android:configChanges="orientation|screenSize"

How can I display everything in Landscape mode, if the app is already on Landscape Mode when calling onCreate()?

Bugdr0id
  • 2,962
  • 6
  • 35
  • 59

1 Answers1

0

Try this

 android:configChanges="orientation|keyboardHidden|screenSize"

answer link

also savedInstanceState is not null if there is change in configuration so for activity B you can use the logic in

if (savedInstanceState != null) 
    {
        Log.v("bundle", "Restored");
    }
vikas kumar
  • 10,447
  • 2
  • 46
  • 52