Ok, yes this is what I'm seeing. Looks like:

  MyActivity: startIntent(maps);
  .. logcat says low memory ..
  System maps intent starts up, looks good, user plays with it a bit.
  User now hits back button
  MyActivity: onCreate() gets called, instead of onResume().

on other phones, this works ok, onResume() is called instead of
onCreate() when hitting the back button. I can't see an explicit
message in logcat saying that my activity is being killed after the
low memory message though. I do see this however:

I/ActivityManager(   76): Start proc com.test.myapp for activity
com.test.myapp/.ui.MyActivity: pid=8427 uid=10036 gids={3002, 1005}

For me, it would be good if the app stays in the history stack even
though it was killed - because when the user hits the back button,
wouldn't they be confused if they get taken back to the desktop
instead of my app (which launched them there)?

Thanks




On Nov 23, 7:48 pm, Mark Murphy <[email protected]> wrote:
> Mark Wyszomierski wrote:
> > If I follow the lifecycle docs correctly, an Activity won't get
> > notified if it's force killed for memory?
>
> Correct. In a true "force kill" scenario, Android needs RAM quickly and
> cannot rely upon you to do something quickly.
>
> > But was does onDestroy() get called, so we have a
> > chance to clean up? Or do we just have to write safeguards in onCreate
> > () to check for a force-kill as mentioned in this post?:
>
> >http://groups.google.com/group/android-developers/browse_thread/threa...
>
> You should never assume that static data, like a singleton, exists,
> unless it is final (i.e., never modified). onDestroy() may or may not be
> called, etc.
>
> That being said, I had kinda assumed, in the case of a force-kill of
> your process for memory reclamation, your activity would also be removed
> from the stack. If your scenario is indeed what's happening, that
> implies that your app's activities remain on the stack despite the
> force-kill, which surprises me.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Development Wiki:http://wiki.andmob.org

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

Reply via email to