Monday, February 6, 2012

[android-developers] How to destroy a background activity without removing it from back stack.

Hi,

I have a problem on some devices like Galaxy Nexus, where my
background activities are not destroyed by the system even when
available memory is low. (It's not a memory leak. I tested it with a
minimal activity, and it's device specific.)

If I can't rely on the Android system to destroy background activities
to get required memory, I need to do it myself manually. However if I
call finish() method, the activity is removed from the back stack, and
the users won't be able to go back the activity by pressing back
button.

So I need a way to manually make my background activities to be
collected, but still be available in the back stack to be restored
(with the savedInstanceState bundle) when users press the back button.
(i.e. just like they've been collected by the system)

Is there any way to do this, or do I have to implement my own activity
history to do this?

Thanks.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate