A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Software Craftsman
this week in the
Regarding OnsaveInstanceState() and onRestoreInstanceState()
Joined: Dec 29, 2011
Nov 05, 2012 09:17:52
Hi im new to Android can anyone please tell me what does these two methods mean (OnsaveInstanceState() and onRestoreInstanceState() ).
and what is the purpose of using these methods...
Thanks in advance
Joined: Sep 14, 2012
Nov 07, 2012 21:01:12
onSaveInstanceState() is a method used to store data before Pausing the activity & onRestoreInstanceState() is method used to retrieve that data back.
Consider this example here:
You app has 3 edit boxes where user was putting in some info , but he gets a call so if you didnt use the above methods what all he entered will be lost.
So always save the current data in onPause() method of Activity as a bundle & in onResume() method call the onRestoreInstanceState() method . !
Hope this helped
Joined: Mar 17, 2013
Mar 27, 2013 07:39:38
i am also a beginner in android programming. I refer to Slidenerd on Youtube for programming on Android. Hope this video helps you. cheeres!!!
Have you tried LearnNowOnline?
subject: Regarding OnsaveInstanceState() and onRestoreInstanceState()
How to handle screen orientation changes
methods for ranking IT compan
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015