Thursday, September 23, 2010

[android-developers] Re: android.app.Application NullPointerException

That absolutely sounds like what is happening, but WHY would my app be
killed and restarted? 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?

I have a login window, the user enters id/pw, i log in through web
service, store some data in my application object, and leave the user
at my main application window. i can then do any of my tasks, other
activities, etc.. using data from the application object.

when i click the icon and get back to the app the next day, it shows
me the main window again, right where i left it. however, the
application object is empty? what's the point of it if the JVM can
kill my app at any time and not store the application object?

help,
eric


On Sep 23, 12:59 pm, TreKing <treking...@gmail.com> wrote:
> On Thu, Sep 23, 2010 at 9:03 AM, elubin <elubin1...@gmail.com> wrote:
> > However, when I leave the app over night and look at it again the next day,
> > I receive NullPointerExceptions when attempting to use that same data.  I do
> > not believe Application objects get garbage collected, so I have no idea
> > what is going on?
>
> > I also lose static objects in classes used by my Activity classes.
>
> Hard to say without more details on how your app is structured, but it
> sounds like your app is being killed and restored, but you're not reloading
> / resetting your data. Perhaps the path through which you do this loading /
> initializing of variables is being skipped?
>
> Logging all of the entry and exit points to your app you give you a better
> idea of what's happening and when.
>
> -------------------------------------------------------------------------------------------------
> 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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment