How to keep the layout in standby mode?

Asked

Viewed 81 times

2

Well I have two layout teste_1 and layout teste_2 , when I turn apparatus for portrait appears teste_1 and when I turn apparatus for landscape appears teste_2, have to leave this layout in standby mode (inactive) so that your data is not restarted when changing orientation.

2 answers

1

Try this on AndroidManifest.xml , within the <activity:

android:configChanges="orientation|navigation|keyboard"

1

You can add the attribute android:configChanges="orientation" within the tag <activity> in his AndroidManifest.xml.

This configuration causes instead of recreating the Activity when changing orientation/configuration, your Activity will have a callback (onConfigurationChanged, if you need to) in place.

  • didn’t work it falls into the same problem as the previous question, you could give an example.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.