I am confused between screen rotation and activity sent back.
My requirement i am trying out in my application is
- when activity goes to idle( meant pressing back ) , i need to stop a
timer.
- When screen rotation happens i shouldnt stop a timer.
I also registered for action_configuration_changed to know when the
screen rotation happens.
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
mContext.registerReceiver(mBroadcastReceiver, filter);
private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver()
{
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) {
//updateBackground();
screeChanged = true;
System.out.println("On screen changed");
}
}
};
When i traced the flow, when back happens this is wat i observed.
Screen rotated from landscape to portrait
I/System.out( 1666): On stop
I/System.out( 1666): On Destroy
I/System.out( 1666): On create
I/System.out( 1666): On resume
I/System.out( 1666): On screen changed
Screen rotated from portrait to landscape
I/System.out( 1666): On pause
I/System.out( 1666): On stop
I/System.out( 1666): On Destroy
I/System.out( 1666): On create
I/System.out( 1666): On resume
I/System.out( 1666): On screen changed
When back pressed:
----------------------------------
I/System.out( 1666): On pause
I/System.out( 1666): On stop
I/System.out( 1666): On Destroy
All these function calls are similar for both usecase... so any clue
how do i differentiate my activity is went back or screen changed.
Could somebody throw lights on my problem.
Thanks,
Mani
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en