Search This Blog

Tuesday 12 June 2012

How to manage the activity state in android?


How to manage the activity state in android?


The activity could go for destruction during its lifecycle by the system. If the system has enough memory the system allows the activities in memory otherwise send the activity to destroy. When user navigates the activity back the system recreate the activity object without notice of user.

In this case the state of the activity is lost. To manage the activity state and data before destroy the onSaveInstanceState Method will be called. All the activity objects can be saved by implementing the callback method.

The data can be resume and process back on onResumeInstanceState method. 

No comments:

Post a Comment