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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:34:43+00:00 2026-06-09T04:34:43+00:00

Example : I have 3 Activities, A,B, and C. from Activity A I open

  • 0

Example : I have 3 Activities, A,B, and C. from Activity A I open Activity B then From B open Activity C. Then I exit application by code :

Intent intent = new Intent(Intent.ACTION_MAIN); 
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
System.exit(0);

I use this code for exit app. But when restart app, back again to recent Activity. My question, How to finish all Activities when exit from app?

  • 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-09T04:34:46+00:00Added an answer on June 9, 2026 at 4:34 am

    You must be back to your main activity first by this code:

    Intent home = new Intent(this, mainActivity.class);
    home.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    startActivity(home);
    

    And then you will exit your application from mainActivity like this:

    finish();
    System.exit(0);
    

    Hope it helps.

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

Sidebar

Related Questions

Hi i'm facing this problem. I have an application with 2 activities: -Activity A
I have a TabActivity that is the base Activity in my application. From the
For example, i have 3 activities.. I also use Tab host with separate activity
I have four activities A,B,C,D. I am passing an text from activity A to
Here's the problem. I ,for example,have a string 2500.Its converted from byte array into
Example: I have an class that inherits from UIImageView. An object creates an instance
Say I have 2 activities (ActivityOne and ActivityTwo). How would I call ActivityTwo from
Say I have two Activities in an Android application, EditPerson and EditEmployee . It
In my Android App I have a main activity and some other activities. The
I have two simple activities A and B . The user starts B from

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.