adspace
Explain the onsavedinstancestate() and onrestoreinstancestate() in activity?
Answer Posted / Mohit Kumar Prasad
onSavedInstanceState() is a method used to save the state of an activity so that it can be restored later when the activity is recreated. This is useful for retaining user data when the activity is recreated, such as when the device orientation changes or the activity is killed by the system. onRestoreInstanceState() is a method called after onCreate() when the instance state has been retrieved and can be used to restore the saved state.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers