简体   繁体   English

如何永久终止Android应用程序?

[英]How to terminate Android application permanently?

I am making an application based on Google map implementation. 我正在基于Google地图实现制作一个应用程序。 Everything is working fine but only one thing Ie, 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). 由于该异常是由地图API引发的(已经在Google API的Maps应用程序中检查了相同的异常)。 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? 谁能帮我解决这个问题,或者给我解决方案?

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">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM