Reputation: 295
I have 2 activities A and B.
I have noticed that instance variables in class A are cleared (reinitialized). Is using onSaveInstanceState(Bundle)
a correct way to save these variables before A gets stopped?
In my onCreate(Bundle savedInstanceState)
method of class A, I try to retrieve the data previously saved by onSaveInstanceState(Bundle)
. However the variable savedInstanceState
is always null and I can't retrieve any data.
Upvotes: 0
Views: 739
Reputation: 1452
If you want to return to your previous activity, you must call finish() on activity B, and then intercept it in activity A with onActivityResult().
Is that what you tried to accomplish?
Upvotes: 3