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


Please Help Members By Posting Answers For Below Questions

Which is the latest version of android?

1089


What all devices have you worked on?

1060


Which is the latest version of android os?

1049


What did you like better, ice cream sandwich or kitkat?

981