08-11-2011 01:53 PM
I might be wrong, but I think you will find that powerUp is also called when the phone has been put into standby. Give it a try and see.
08-11-2011 02:01 PM
hi peter,
powerUp() is Invoked when the internal battery state has changed .
08-11-2011 07:56 PM
"powerUp() is Invoked when the internal battery state has changed ."
Don't think this is a true, certainly it is not what the API says.
But in this case, the OP wants a method to detect complete reset or battery pull, both of which will remove ApplicationMenuItems. powerUp is called on return from the device entering standby, for example when the user presses the powerOff icon, and then presses the appropriate button to bring the device back to life. This 'powerOff/PowerUp will not have cleared the ApplicationMenuItems. So powerUp is unfortunately not an appropriate place to detect a system reset or battery pull.
08-12-2011 12:51 AM
Hi peter,
I have checked it, It is not called when device go to StandBy mode.
you also can check the same.
08-12-2011 01:56 AM
I've added the variable/flag to the runtime store as peter suggested and made some code changes and it's working great thanks.
Topic solved and reply "liked" on previous page ^_^
08-12-2011 03:29 AM - edited 08-12-2011 03:32 AM
@OP - great, glad that worked for you.
@gaurav_dhingra - I suggest you check again. Just for clarity, powerUp is not called when going into standby, that is when powerOff is called. What I said was "powerUp is called on return from the device entering standby". At that time ApplicationMenuItems are not removed.
So I suggest powerUp itself is not an appropriate place to detect reset or battery pull. Not because it doesn't get called, but because it is called in other circumstances.
If you check and find something different, feel free to PM me with the details of your testing so that I can replicate it.