Skip to content

Save instance state

matboniface edited this page Mar 12, 2012 · 3 revisions

Since AndroidAnnotations 2.5

You can save instance state when activity is killed by annotating your attributes :

@InstanceState
int someId;

@InstanceState
MySerializableBean bean;

Your attributes values are automatically saved when the system call [onSaveInstanceState(Bundle)](http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle\)). All of those values are restored when [onCreate(Bundle)](http://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle\)) is called by the system.

Using AndroidAnnotations

Questions?

Enjoying AndroidAnnotations

Improving AndroidAnnotations

Clone this wiki locally