[android-developers] Re: Possible to Detect if OnResume is because Back button was hit?
A) I do some logging of information if a user goes back to a page from a back button versus some other way of accessing the page. B) I had tried the startActivityForResults but was curious what other way people have done it. On Mar 11, 12:02 am, TreKing treking...@gmail.com wrote: On Wed, Mar 10, 2010 at 6:47 PM, Sam samm...@gmail.com wrote: I wanted to know if it is possible to Detect in an Activitiy's OnResume if the Activity is resuming because the devices Back button was hit or not? A) Why do you want to do this? Sounds hacky. B) If you start the Activity with startActivityForResult() the first activity will get it's onActivityResult() function called, indicating that the activity it started has finished. - TreKing - Chicago transit tracking app for Android-powered deviceshttp://sites.google.com/site/rezmobileapps/treking -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Possible to Detect if OnResume is because Back button was hit?
I kind of do something like this. I set a flag to false onResume and then set it true if the back button is hit. onPause, if that flag is true, I know it's because my user is backing out and I can respond in a certain way (knowing that we'll be going back to a previous activity). The previous activity won't know anything about this, though. I use a static music manager and that is how I handle inter- menu game music. What's your specific need? Maybe I can help out more then. On Mar 10, 6:47 pm, Sam samm...@gmail.com wrote: Hi, I wanted to know if it is possible to Detect in an Activitiy's OnResume if the Activity is resuming because the devices Back button was hit or not? Sammy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Possible to Detect if OnResume is because Back button was hit?
Are you saying if you're on Activity A - Activity B, hit Back Button from Activity B, a static flag is set to true on the back key, When Activity A resumes, you check that static variable, and do your logic, then set the flag back to false? On Mar 10, 8:27 pm, Robert Green rbgrn@gmail.com wrote: I kind of do something like this. I set a flag to false onResume and then set it true if the back button is hit. onPause, if that flag is true, I know it's because my user is backing out and I can respond in a certain way (knowing that we'll be going back to a previous activity). The previous activity won't know anything about this, though. I use a static music manager and that is how I handle inter- menu game music. What's your specific need? Maybe I can help out more then. On Mar 10, 6:47 pm, Sam samm...@gmail.com wrote: Hi, I wanted to know if it is possible to Detect in an Activitiy's OnResume if the Activity is resuming because the devices Back button was hit or not? Sammy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en