Reputation: 534
I need to handle display rotation in android and I know about handling Activity.onConfigurationChange
with android:configChanges
flags in manifest, but it does not work for me.
Unfortunately, onConfigurationChange is handled only when I change device orientation from portrait to landscape and vice versa, but it is not handled when I change orientation directly from landscape to landscape inverted i.e. from rotation 90 to 270. So, I need some callback, that will be called when result of android.view.Display.getRotation()
changes. Any ideas?
Upvotes: 1
Views: 139
Reputation: 2219
When your orientation changes , Android system will create a new View and your app probably getting crashes.reason behind this is your background thread is trying to change the state on the previous one . the another reason is that your background thread isn't on the UI thread. my suggestion is that to making one handler that volatile and updating it when the screen orientation changes.
Upvotes: 1