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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:25:41+00:00 2026-05-16T17:25:41+00:00

This app has multiple activities: eg: Activity1 -> Activity2 -> Activity3. If the app

  • 0

This app has multiple activities: eg: Activity1 -> Activity2 -> Activity3. If the app is opened after the Home button is used while in Activity2, the app returns to Activity2, but the desired functionality is for the app to always start with Activity1 from the launcher. Adding a finish() to the onStop() for Activity2 does cause app to start with Activity1 following use of the Home button, but then Activity3 causes the app to revert to Activity1 when it finishes, rather than Activity2, which is also undesirable. Is there a way to force the app to always start with Activity1 following use of the Home button?

public class Activity1 extends Activity {
    ...
    public void onCreate(Bundle savedInstanceState) {
        ...
        button1.setOnClickListener(new OnClickListener() {
            public void onClick(View arg0) {
                startActivity(Activity2);
                ...

public class Activity2 extends Activity {
    ...
    private boolean applyMenuChoice(MenuItem item) {
        switch (item.getItemId()) {
        case R.id.menuItem1:
            startActivity(Activity3);
            ...
  • 1 1 Answer
  • 1 View
  • 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-16T17:25:41+00:00Added an answer on May 16, 2026 at 5:25 pm

    You can configure this for your activity in your AndroidManifest.xml. I think the attribute you want is android:clearTaskOnLaunch.

    You may want to check out what you can do with the activity element from the android dev guide.

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

Sidebar

Related Questions

SETUP : I have this app which has 4 activities in a linear path,
The interface of my iPad app has multiple section boxes (looks similar to this
I'm making an app and it has multiple button that when you press them
Hi I'm writing an app that has multiple activities. Right now it starts at
I'm writing an app that has multiple activities. Activity A calls Activity B, not
I am running into a peculiar issue with an app which has multiple Activities.
I have a web application running on Windows IIS. This app has a database
So my app has the status bar set to be hidden like this in
My swing app has a main window which has sever buttons. This JFrame is
Is it possible to code this sequence of events once an iPhone app 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.