memory - Android onSaveInstanceState Bundle -


when android kills process due system constraints gives ability persist data across processes storing data in bundle. bundle saved if process killed? process live in? in memory live in? live in kernel memory?

kernel memory protected memory space critical code kernel code reside. prevent interference of data user , of kernel , other performance , design reasons. kernel memory persist through reboot.

the data being persisted in bundle passed in method of onsaveinstancestate() - before user leaves activity not before activity gets destroyed. means memory not written in static memory area memory card. bundle indeed persisted in more dynamic way.

while question has not been directly answered, looks memory on ram. when @ performance of android devices, more recent devices more ram seem capable of holding on apps longer

from official documentation @ http://developer.android.com/training/basics/activity-lifecycle/recreating.html, understood memory tracked android itself.

by default, system uses bundle instance state save information each view object in activity layout (such text value entered edittext object). so, if activity instance destroyed , recreated, state of layout restored previous state no code required you. however, activity might have more state information you'd restore, such member variables track user's progress in activity.

to save additional data activity state, must override onsaveinstancestate() callback method. system calls method when user leaving activity , passes bundle object saved in event activity destroyed unexpectedly. if system must recreate activity instance later, passes same bundle object both onrestoreinstancestate() , oncreate() methods.

also keep in mind bundle gets destroyed when device shuts down. android might have specially designed memory area either way somewhere in ram.


Popular posts from this blog