I am experimenting with TabHost
and ActivityGroup
when I noticed that if I pressed back on one activity, the whole ActivityGroup
is destroyed. As such, I created a list of Views representing my activities. However, this causes my previous activity to lost its state. I even setup the freezesText
of my EditText
on the previous activity to 'true' but this does not help in preserving its value.
Can you explain me how the ActivityGroup
works and how it manages it sub-activities? Right now, I get the impression that ActivityGroup
only switches the views, not activities. Am I correct with that? I am getting more and more confused here. How can I make it work such that if I pressed back on one activity, the previous activity will be recovered based on its last state? (Like what happens when a normal activity calls another activity then the user presses back.)
This is what I want to happen:
- ActivityGroupA (ActivityGroupA was launched. User inputs details on ActivityGroupA.)
- ActivityGroupA > ActivityB (User presses 'submit'. ActivityGroupA calls ActivityB.)
- ActivityB > ActivityGroupA (User presses 'cancel'. ActivityB is destroyed. ActivityGroupA is now the top of the stack again.)
Is this possible? How can I do it?