On 21 Maj, 21:26, Tom <[email protected]> wrote:
> My app consists of an Activity and a service that runs in the
> background. The service periodically checks a website for an alarm
> condition. When the service detects the alarm, it should put a user
> notification into the status bar. If the user clicks the notification,
> it should display the app's activity. If the activity is already
> running, that activity should become visible. If the activity is not
> currently running, it should be created.
>
> However the notification created by my service *always* creates a new
> instance of the activity, whether the activity is currently running or
> not. How do I get the desirable behavior?

Try to set
android:launchMode="singleTask">
attribute for your Activity in AndroidManifest. I couldn't find
another way.

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