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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:28:10+00:00 2026-06-05T21:28:10+00:00

I’ve read some posts stating that using this method is not good, shouldn’t be

  • 0

I’ve read some posts stating that using this method is “not good”, shouldn’t be used, it’s not the right way to “close” the application and it’s not how Android works…

I understand and accept the fact that the Android OS knows better than me when it’s the right time to terminate the process, but I haven’t yet heard a good explanation on why it’s wrong to use the killProcess() method. After all – it’s part of the Android API.

What I do know is that calling this method while other threads are doing potentially important work (operations on files, writing to DB, HTTP requests, running services..) results in the threads being terminated and it’s clearly not good. Also, I know I can benefit from the fact that “re-opening” the application will be faster because the system stills “holds” in memory state from the last time the app was used, and killProcess() prevents that.

Besides this reason, assuming I don’t have such operations, and I don’t care my application whether my app will start from scratch every time it is opened, are there other reasons why I should not use the killProcess() method?

I know about the finish() method to close an Activity, so please don’t include that in your answer.

finish() is only for Activity, not for all applications, and I think I know exactly why and when to use it.

And another thing – I’m developing games with the Unity3D framework and exporting the project to Android. When I decompiled the generated apk, I was very surprised to find out that the java source code created from unity – implementing Unity’s – Application.quit() method, with Process.killProcess(Process.myPid()).

Application.quit() is supposed to be the right way to close the game according to the Unity3D docs (Is it really? Maybe I’m wrong and missed something), so why did the Unity’s framework developers implement this in native Android?

  • 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-05T21:28:12+00:00Added an answer on June 5, 2026 at 9:28 pm

    Who said calling Process.killProcess(Process.myPid()) is a bad idea?

    Yes, letting the OS manage its own memory is the best practice for both you and the user using your application (faster to open again, less chances for force closes, etc…).

    However, assuming you know for sure that you’re not interrupting threads or other background operations and you use this call in onDestroy() – I see no reason why you shouldn’t use it. Especially when it’s an API call and not a workaround, and Google didn’t mention it’s better not to use it in the API documentation.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I need a function that will clean a strings' special characters. I do NOT
I have some data like this: 1 2 3 4 5 9 2 6
I am using parse_ini_file to read the contents of a file however it is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small

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.