I am facing very strange problem in handling orientation of activity. Let me explain the scenario
I have Activity A and B.Currently A is in landscape mode and B(fixed) is in portrait mode. I am saving state of activity A if user change orientation of A. I went from A (landscape) to B(portrait) so in that case A is in background so it should call onSaveInstance(bundle) method. But it calls and when i come back then A's on Resume() called and i got exception onResume() can not called after onSaveInstance() for A.
This is something , make me annoying.
Update Edit
If both activity can have any orientation. Then activity A onSaveInstance(bundle) does not call while going to B and It works well
Even though i still waiting for some logical description. But i solved my problem. When you are going from Activity A to B onsaveInstance() of a calls in every case. So when coming back activity restarted but onsaveInstance() does not call again. So i was getting
onResume() can not be called after onSaveInstance(Bundle)
Reason - I think as activity state is already save so it can not called onResume(). And main issue is onSaveInstance(Bundle) is not a part of activity life cycle so its very painful situation.
Solution - I remove super.onSavaInstance(Bundle) from onSaveInstance(Bundle). And problem solved. Its still working for orientation changes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With