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 8735235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:00:37+00:00 2026-06-13T10:00:37+00:00

My application start foreground service witch keep connection to server. It’s show notification with

  • 0

My application start foreground service witch keep connection to server. It’s show notification with pendingIntent witch show MainActivity. When i (user) tap on application icon (on desktop or application list) it’s show “task stack”. I mean if was lunched MainActivity it shows it, if user go to activity B or C (or lunch some other activities) it shows it (i mean top activity from task stack). There is a problem – if user tap on notification he see again MainActivity (on the top of the stack) but i expect top of tack stack (activity B,C or other witch was lunched by user at the end).

Half solves when i set attribute for MainActivity “singleTask”, now it’s always root of task stack, BUT a’m loosing all activities (B, C and other wich user lunched). Solution like in Reuse Activity on Top of Stack simular, but i need only one activity at root.

Maybe my logic is wrong and i need some another way to resolve this problem. But i want to know how can i programmaticly show task stack (top activity) like application icon does?

  • 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-06-13T10:00:39+00:00Added an answer on June 13, 2026 at 10:00 am

    The documentation Tasks and Back Stack describes how to handle navigation correctly.

    In short, if users tap on your navigation and you take them to an Activity in your app, when they click Back they should up in your app’s Activity hierarchy until they reach the Home screen. They should never go to the stack in another task. That is, if they’re in your app in Activity C, and you send a notification which they click that takes them to Activity A, then clicking Back should take them to the parent of A, and not to C. If they want to go to C, they can use Recents.

    On older platforms, Recents isn’t available.

    This is by design.

    To construct the proper synthetic back stack, use TaskStackBuilder

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

Sidebar

Related Questions

I am trying to start a foreground service at boot time, but it never
Is it possible to start an application in the foreground from the background agent?
My Android application is a foreground service and I would like the option of
I have created one application in which I want to start service when application
On application start I'm creating Config object (Singleton). How could I make Config object
My idea is to make an application start automatically when a message from a
I wrote these lines in My Application start event: var mongo = new Mongo();
I want to put some images in an area at the application start. As
How can we have the bluetooth discoverable status on application start I have an
I have in my application many bitmaps. They are loaded when application start. In

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.