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

  • SEARCH
  • Home
  • 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 7020405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:18:52+00:00 2026-05-27T23:18:52+00:00

EDIT : please note: i completely re-explained my question. I have application with two

  • 0

EDIT: please note: i completely re-explained my question.

I have application with two Activites: A and B. Activity A is MAIN. So, application starts, and A appears on the screen. User press the button on it, and new Activity B appears on the screen.

So, there’s now 2 activities in my “back stack”: A and B.

Now I press “Home” key, and then click on my app’s icon on launcher: Activity B appears on the screen (not A), as far as it is top activity in my task.

Now question: how can i make Intent to similarly open the currently top Activity of my task?

I need it to use in Notification: when user clicks on my Notification, top Activity of this task should appear on the screen, not a specified one.

I tried many Intent flags, such as SINGLE_TOP and others, but i still can’t get what i need.

Does anyone know the solution?

  • 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-27T23:18:53+00:00Added an answer on May 27, 2026 at 11:18 pm

    Well, after spending several hours some days, i found the solution:

    Intent notificationIntent = new Intent(this, MainActivity.class);
    notificationIntent.setAction(Intent.ACTION_MAIN);
    notificationIntent.addCategory(Intent.CATEGORY_LAUNCHER);
    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
    

    That’s the way which launcher starts applications, and it works nice for notification Intent too.

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

Sidebar

Related Questions

EDIT: Please note that this question is OUTDATED; RVM got way easier to use
Please note the Edit below for a lot more information, and a possible solution
Please let me know if you have any idea about it. Thanks EDIT What
EDIT: Please note that while I received an answer, I don't understand what's wrong
EDIT: Please note that the app comes up just fine in Passenger/Apache2. Just not
I'm not sure what kind of terminology to use in this so please edit
**EDIT: There are several options below that would work. Please vote/comment according to your
Why new()/delete() is slower than malloc()/free()? EDIT: Thanks for the answers so far. Please
Edit: This question was written in 2008, which was like 3 internet ages ago.
Edit: From another question I provided an answer that has links to a lot

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.