m not 100% sure but i feel this could help

http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle)

but i feel if u can save the state of the objects
onSaveInstanceState(android.os.Bundle)
and restore them on onRestoreInstanceState(android.os.Bundle)



On Sep 24, 10:47 am, TreKing <treking...@gmail.com> wrote:
> On Thu, Sep 23, 2010 at 8:36 PM, elubin <elubin1...@gmail.com> wrote:
> > That absolutely sounds like what is happening, but WHY would my app be
> > killed and restarted?
>
> I'm guessing because it's idle long enough and Android feels like killing
> it. If you're leaving your app alone over night, likely your phone is going
> to sleep, pausing your app. Left in this state long enough, it's not
> surprising that it would be killed eventually.
>
> > You are correct, if it gets restarted on the main window then i am not
> > refilling my application data.  I only fill it on the login window.  Do I
> > misunderstand how application data is supposed to work?
>
> Perhaps. As Dianne usually advises, you should scrap the Application idea
> and use a lazy-loading Singleton object to store your global / app-wide /
> static data as necessary.
>
> >  what's the point of it if the JVM can kill my app at any time and not
> > store the application object?
>
> Well, I guess the point is to have the notion of an object that represents
> your app as a whole. But it's not the system's job to store and restore it's
> state - that's your job.
>
> On Thu, Sep 23, 2010 at 11:56 PM, Frank Weiss <fewe...@gmail.com> wrote:
> > I think the lesson is that an Android application and
> > android.app.Application are frequently mistakenly assumed to behave the same
> > as an "application" on other operating systems.
>
> Yes, this is an important point. OP, you must remember that leaving your app
> "open" does not mean it will never close as it does on Windows, for example.
> Android will kill it and restart it as need be - it only *appears* to have
> remained open since it restarts in the last activity you left it in.
>
> ---------------------------------------------------------------------------­----------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to