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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:44:09+00:00 2026-06-16T22:44:09+00:00

I want close android app int id= android.os.Process.myPid(); android.os.Process.killProcess(id); This code kills the Process.

  • 0

I want close android app

int id= android.os.Process.myPid();
android.os.Process.killProcess(id);

This code kills the Process.

  • 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-16T22:44:10+00:00Added an answer on June 16, 2026 at 10:44 pm

    If you always want your app to start with the root activity (the first activity) every time the user launches the app from the home screen or returns to it from the list of recent apps, then add this to the manifest in the <activity> tag for your root activity:

     android:clearTaskOnLaunch="true"
    

    However, if you want to just finish all activities in the current task you can do the following:

    Intent = new Intent(this, MyRootActivity.class); // MyRootActivity should be the name of your root (launcher) activity
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    intent.putExtra("exit", "true"); // This tells MyRootActivity that you want to exit
    

    This will cause all activities in the task to be finished and it will create a new instance of MyRootActivity. In MyRootActivity.onCreate() do the following:

    if (getIntent().hasExtra("exit")) {
        finish(); // We want to exit the application, so just finish this activity now
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first try to work with databases in android.i want my app
I have this problem since I'm beginning in OOP programming I want to close
I have a main window, that opens another window. I want to close this
I'm making a android quotes app which use data in database. i want to
I have this code. I want to exit my Java Application if it detects
In my Android app, I want to prompt the user at some point of
I'm developing Android app, and I need save and load functions. I want to
I'm close to finishing my first Android app, but I'm fighting with an odd
I have a problem with my first Android App. I want to ask a
I want to concatenate two files in android. I did this from the Terminal

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.