Hi Dianne,

Thanks for the information, yeah I do see other kill statements like:

I/ActivityManager(   76): Killing app
com.google.android.apps.googlevoice (pid 7579) because provider
com.tmobile.myfaves.MyFavesProvider is in dying process
android.process.acore

but I can't find one like that for my process. After the map intent is
launched, I do see this for all my live activities:

I/WindowManager(   76): WIN DEATH: Window{432755c8 com.test.myapp/
com.test.myapp.ui.ActivityStart paused=false}
I/ActivityManager(   76): Process com.test.myapp (pid 8293) has died.
I/WindowManager(   76): WIN DEATH: Window{43485630 com.test.myapp/
com.test.myapp.ui.ActivityTest paused=false}

If I read the lifecycle doc right, implementing onSaveInstanceState()
will solve my problem here. It is guaranteed to be called even if my
app is killed. Then (like in this case) when my app has its onCreate()
method called, whatever I saved in onSaveInstanceState() will be there
for me,

Thanks

On Nov 23, 8:14 pm, Mark Wyszomierski <[email protected]> wrote:
> 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