Android- Application Settings Force Stop

I didn't use any services in my application and closing the application by using

this.finish();

but my application still not stopped properly and it is running in background.when i go to application settings the force stop button is still enabled.

kindly share your views on proper exit of android application.

Upvotes: 1

Views: 384

Answers (1)

Ken
Ken

Reputation: 31161

It's quite possible you have another activity around.

From the Android docs, see Activity.finish():

Call this when your activity is done and should be closed. The ActivityResult is propagated back to whoever launched you via onActivityResult().

There's no promise made that the activity will be closed right away on calling finish(), only that this is something that should be done. Usually this does happen right away, but without seeing your project I cannot comment further.

Note that Android, unlike iOS, doesn't really have a well-defined notion of an app. "Apps" can share activities and so on. For example it's not hard, but it's also non-trivial, for an "app" to know that it will go to background or that it has resumed.

Upvotes: 1

Related Questions