Life Cycle of Activity - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Life Cycle of Activity

Life Cycle of Activity


To save Activity instance variable, Android offers two variataion of Shared Preference. The first uses a Shared Preference named specifacally for your Activity other relies on a series of lifecycle event handlers.

Saving Activity State

If you want to save Activity information that does not need to be shared with other components (e.g. class instance variables), you can Activity.getPreferences() without specifying a Shared Preferences name.

Saving and Resorting Activity

Activity offers the onSaveInstanceState handler to persist data associated with UI state across session.
If an Activity is closed by the user (by pressing the back button), or programmatically with a call to Finish, instance state bundle will not be passed in to onCreate or onRestoreInstanceState Activity is next created.
Overriding an Activity's onSaveInstanceState event handler, use its bundle parameter to save. UI instance vale . Store value using the same put method .


Activity complete its activity life cycle,but only when it's not being explicity finished with call to finish.

About EasyToCode

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.