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

The Archive Base Latest Questions

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

Ordinarily, exiting my application by calling: android.os.Process.killProcess(android.os.Process.myPid()); performs well without incident. But every once

  • 0

Ordinarily, exiting my application by calling:

android.os.Process.killProcess(android.os.Process.myPid());

performs well without incident.

But every once in a while, the application will restart again (after exiting!).

The relevant log snippet shows:

.631: I/Process(15495): Sending signal. PID: 15495 SIG: 9
.641: W/AudioFlinger(121): write blocked for 252 msecs, 1279 delayed writes, thread 0xdc18
.651: I/ActivityManager(164): Process com.ef.myapp (pid 15495) has died.
.651: I/WindowManager(164): WIN DEATH: Window{463659e8 com.ef.myapp/com.ef.myapp.MainActivity paused=false}
.661: I/AudioService(164):  AudioFocus  abandonAudioFocus() from android.media.AudioManager@460b2b98
.701: I/ActivityManager(164): Start proc com.ef.myapp for activity com.ef.myapp/.MainActivity: pid=15589 uid=10077 gids={3003}

I know that, by the design of the Android OS, killProcess() isn’t the proper way to terminate an application. This is because killProcess() stops the process immediately without giving any way or chance for the app to prevent it or prepare for it.

I know that when I call finish(), the application stack is just pushed to the background (and still exists in the memory). Android itself decides when to close the application (i.e. remove its instance from the memory) and generally this is done when the application becomes “the oldest not used for the longest time”. Its behavior is actually more predictable if it’s really the last one.

The problem is that finish() only stops and destroys the activity for which it was called. It doesn’t stop other activities spawned by the application or other activities. So, for ease of test & debug during development, I am using killProcess() as a convenient shortcut.

But now I see that this has the side effect of the application sometimes restarting immediately after killing itself — all within 30 milliseconds.

A straightforward solution would be to iterate through all application’s activities and finish() them. But before proceeding with this, I am dying to understand what in the Android OS makes an application resurrect itself.

Why would Android make a killed Application restart?

And why inconsistently? (i.e. sometimes)

  • 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:30:02+00:00Added an answer on June 9, 2026 at 4:30 am

    There is a known bug in the way applications get started the first time from the installer, web-browser and via IDE (IntelliJ, Eclipse, etc.). Please try to install your app without starting it and then start it from the list of available applications and see if the problem goes away. See these issues filed long ago related to the problem:

    http://code.google.com/p/android/issues/detail?id=2373

    http://code.google.com/p/android/issues/detail?id=26658

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

Sidebar

Related Questions

Ordinarily I wouldn't just post an error message on SO, but after a Google
Let me begin by admitting that I am ordinarily a Java programmer, but I
Ordinarily, using form_for(@foo) means that on the back end of the form's action, you'll
I've got a pretty ordinary Java EE application running on JBOSS. It uses the
It's possible to do interesting things with what would ordinarily be thought of as
We want to grant automatic access to premium content (that is ordinarily password protected)
I'm working on a web application. One of my co-workers has written some asp.net
I need to use a WCF API to save data into a DB. Ordinarily,
in my application, I have a User model. Each user can have multiple (email)
Dygraphs ordinarily automatically picks Y- (and X-) axis labeling points based on the size

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.