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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:23:21+00:00 2026-05-22T22:23:21+00:00

Suppose an application already has a stack of activities, and then a new activity

  • 0

Suppose an application already has a stack of activities, and then a new activity is started from the application context with FLAG_ACTIVITY_NEW_TASK. And this happens within the same process, i.e. inside the application, like this:

AppContext -> A(FLAG_ACTIVITY_NEW_TASK) -> B -> C; AppContext -> D(FLAG_ACTIVITY_NEW_TASK)

According to the documentation we have 2 tasks now:

Task 1: A, B, C; Task 2: D

It follows from the doc that it is theoretically possible for the user to switch either to activity C or to activity D independently, as they belong to different tasks. In practice, however, I wasn’t able to switch to activity C – it always switched to D.

My question is:
Is it true that, if started in the same process with FLAG_ACTIVITY_NEW_TASK, tasks are not independent and the user can only switch to the topmost activity in the topmost task?

If the answer is “no” then what is the way for the user to switch to task 1?


UPDATE

The answer is: No
The tasks are independent and the user can switch between their activities independently, effectively having two activities of your app on the top of the stack. I just found the use case, three years after asking the original question.

Our app registers itself as a handler for a URL scheme (like market://xxx.yyy/zzz). Now let’s imagine the user started the app with the launcher, got into a middle of something (activities A, B, C), and left off. Then in the browser the user clicks on a URL so our other activity is launched (activity D). This results in having two tasks in the same time: activities A, B, C (with C on top) and activity D. The user can switch between these two activities via task history.

Funny that Activity C is visible in the task history with the app’s own icon but the Activity D is visible with the browser’s icon. Regardless, both can be switched to.

Also, both tasks A-B-C and D run in the same process. This means that all singletone objects and static data are shared between them. As a result, they may corrupt each other’s state if caution is not taken.

  • 1 1 Answer
  • 3 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-22T22:23:22+00:00Added an answer on May 22, 2026 at 10:23 pm

    It’s been a while after I’ve asked this question when I came across this link which I find very useful. It describes all flags and combinations very clear.

    http://blog.akquinet.de/2010/04/15/android-activites-and-tasks-series-intent-flags/

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

Sidebar

Related Questions

Suppose this simple scenario: My client has an already working .net application and he/she
Suppose user has opened my web application in many different browser windows. After sometime
We're currently rewriting our organizations ASP.NET MVC application which has been written twice already.
I have a basic question. I already have a RoR application which has hundreds
I am adding new features to my already developed application. I am trying to
My Java application has started to crash regularly with a SIGSEGV and a dump
Suppose an application with some forms and only one data module are created at
Suppose the following application landscape: +-----------------+ | App server | +-----------------+ | | +-------+
Suppose a large composite application built on several foundation components packaged in their own
Suppose I am writing an application in C++ and C#. I want to write

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.