+ onRestart(): update the UI and data state (if needed) in case the user switched away from the activity and came back.
2011/11/13 Streets Of Boston <[email protected]> > What Mark said below :) > > And note that when the onStart is called, the activity becomes visible. > When the onResume is called, the activity is about to receive focus > (becomes for target user interaction). > > E.g. when a dialog-style activity (an activity with a partial transparent > background) is put on top of another activity, that other activity's > onPause is called (it's losing user-focus). It's onStop is not called (it > is still (partially) visible). > > This is what I usually do: > onCreate: Inflate layout; assign child-views from the inflated layout to > my activity's fields, register listeners, etc.; maybe assign/setup stuff > that would be valid during the entire lifecycle of an activity; assign data > to the Views (from the Intent). > onNewIntent (if needed): assign data to the Views (from the Intent). > onStart: Restart stuff that needs to be stopped in the onStop. > onResume: Restart stuff that needs to be stopped in the onPause. > onPause: Stop stuff that would not have any visual effect on the activity > when it is stopping (note that activity could still be partially visible). > onStop: Stop all expensive visual stuff. > onDestroy: Clean up all that is servicing this activity. > > As you can see, there is a lot of mentioning of 'stuff'. It really depends > on your app and your activities. > > -- > 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 > -- 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

