You really shouldn't do this kind of thing in Application.onCreate().
This is called the first time your process is created...  so after the
first time your activity is run, there is really no defined time it
will be called again.  It may be called a lot (if there is lots going
on in the device, every time the user goes another app your app gets
killed, so upon returning to your app in whatever its last state was
will have it called), it could be called almost never (if your process
can be left in the background for a long time).

You should use Activity to drive all of your UI.

When exactly are you wanting to show the message?

On Oct 29, 8:55 am, Ludwig <[EMAIL PROTECTED]> wrote:
> Classes derived from Application have an onCreate() method that gets called
> when the application (as opposed to any individual activity) gets started.
> You will need to create a derived class and declare it in the manifest,
> e.g.:
>     <application android:name="MyApplication" android:icon="@drawable/icon"
> android:label="@string/app_name">
>
> HTH
> Ludwig
>
> 2008/10/29 zl25drexel <[EMAIL PROTECTED]>
>
>
>
> > Hi all
>
> > My app has some logics to check the gps status and shows an message
> > when its disabled. Currently i put those logics in the onCreate()
> > method of my apps's main activity. However, it turns out that this
> > onCreate() method is called very frequently rather than once per
> > application startup. That makes the notification message quite
> > annoying.
>
> > Is there any life cycle call back method that is only call once on
> > application start up?
--~--~---------~--~----~------------~-------~--~----~
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