Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6854193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:36:12+00:00 2026-05-27T01:36:12+00:00

My service has a notification with an intent to launch the associated activity, but

  • 0

My service has a notification with an intent to launch the associated activity, but I find sometimes that when pressing back in my activity it returns to a previously loaded activity, so it looks like there are sometimes where there are more than one copy of the activity in memory. How can I avoid this? I suppose I must bring to front in case exist or launch a new one but dont know exactly how.
thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:36:12+00:00Added an answer on May 27, 2026 at 1:36 am

    In you AndroidManifest.xml add android:launchMode="singleTask" with the as attribute with the desire activity you want to run only 1 instance.

    e.g

    <activity
            android:name=".MyActivity"
            android:launchMode="singleTask">
    

    You can even use Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT
    flag with you activity intent. So that when activity is already running it will be brought to front instead of creating new.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to implement IPhone's push notification service for a Webapp that has
I have an Activity that starts a Service. In my Activity: startService(new Intent(this, MyService.class));
We have a service that has some settings that are supported only over net.tcp.
I have a service that has a dependency on SQL server express (2005). Every
Is there a way to send a notification to the user that app has
I wanted to start using the Amazon Simple Notification Service ( http://aws.amazon.com/sns/ ), but
I am having issue when sending data from Service to Activity through Notification ,
An intent for an Activity (RluSvcMenu) is fired from a Service when a user
I need to create an activity that starts a service that monitors the users
I have a situation where I am running in a WCF service that has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.