Robert Smith
Robert Smith

Reputation: 457

How to terminate Android application permanently?

I am making an application based on Google map implementation. Everything is working fine but only one thing I.e., when mapview is panned or zoomed, at a certain level the mapview crashes and my previously visited activity is shown with no data. Since the exception is thrown by map API (already checked the same exception in Google API's Maps application). Now my requirement is to force close or force stop even from task manager. I caught the exception in activity's

Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {

            public void uncaughtException(Thread thread, Throwable ex) {

}  
});

I can track the exception but unable to terminate. I used

Android.os.Process.killProcess(Android.os.Process.myPid())   
System.exit(1)                    
moveTaskToBack(true)   
finish()  

every possibilities, but nothing happened. The application is terminated, but it still stays in task manager where from user can start the application again with last visited activity with no result. Can anyone please help me out of this problem or give me a solution?

Upvotes: 0

Views: 659

Answers (1)

idiottiger
idiottiger

Reputation: 5177

if your application be killed, it always show in the recent app lists.

you can make your application dont show in the recent app lists:

 <activity
            android:name=".Demo"
            android:label="@string/app_name"
            android:excludeFromRecents="true">

Upvotes: 1

Related Questions