Issue
I am calling a method that populates a spinner from files in onCreate Method? As per the life cycle of andriod goes after it stops or if i use another apps it shouldnt populate spinner. however it is populating. Can you tell me why?
Solution
Once it is populated in onCreate()
, it will stay populated unless you quit the activity. If you use some other app or just press the home button the activity may not be destroyed. It might simply be in the paused
state. Once you come back to your activity it will simply resume
itself to the last state it was in i.e. the spinner will remain populated. Android might decide to kill activities in the paused state as well if memory is low.
If you want to quit the app, Press the back button while you are in the activity. Then the activity will probably be destroyed and when you open it again, onCreate()
will be called and the spinner will be repopulated.
Answered By - Anup Cowkur
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.