>>>>> "T" == TreKing  <treking...@gmail.com> writes:

   T> On Thu, Jan 17, 2013 at 2:40 PM, Jake Colman <col...@ppllc.com>
   T> wrote:

   >> If the application or widget is installed and that condition
   >> already exists at the time of installation, the notification is
   >> triggered.
   >> 

   T> That doesn't make sense. You can't do anything when your
   T> *application* is first installed.

First, please forgive (and correct) any incorrect usage of Android
terms.

In my Application class all I do is override onCreate so that I can
initialize ACRA.  Any "work" is being done by the widget's broadcast
receiver and by an associated service class.  When the application is
created, it has no shared preferences with pre-existing values.  So when
the associated service is started it assumes that it has to trigger a
notification.  It knows if a notification has been triggered already so
it doesn't do it again.  When the application is recreated I assume that
it loses the previous incarnations shared preferences and, therefore,
the service doesn't know that it already triggered.  Hence, the false
trigger when the application is recreated.

   >> Why would Application.onCreate be invoked by Android after the
   >> application and widget were already installed and without the user
   >> doing anything?
   >> 

   T> That would indicate your process was killed and restarted. If the
   T> widget was the only thing you have running, then either it or
   T> perhaps the home screen it was running on were killed. Not likely,
   T> but possible.

I don't see any reason why I should have been killed.  I checked with my
user and they are not using a task killer.

   T> Why do this check in onCreate? Why not do it strictly when the
   T> widget is installed?

Which check?  Did my earlier paragraph explain what I think is
happening?

-- 
Jake Colman -- Android Tinkerer

-- 
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