简体   繁体   English

我无法完成/关闭我的申请

[英]I am not able to finish/close my application

I have used Open Finish Activity using intent here : 我在这里使用Intent使用了Open Finish Activity:

    Intent i = new Intent(yourScreen.this,Finish.class);
    i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    startActivity(i);

Then I have used. 那我已经习惯了。

public class Finish extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    System.runFinalizersOnExit(true);  //  1)Option
    System.exit(0);                    //  2)Option
    finish();                          //  3)Option
    android.os.Process.killProcess(android.os.Process.myPid()); //4)last
 }}

I have try all options 我尝试了所有选项

here my Application gone in background. 这里我的应用程序在后台运行了。 when i click my hardware apps menu button then its appear in list. 当我单击硬件应用程序菜单按钮时,它就会出现在列表中。

Could you try it for us, please? 您能为我们尝试一下吗? :D :D

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
     finishAndRemoveTask();
} else {
     finish();
}

暂无
暂无

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

相关问题 如何隐藏我的应用程序但不关闭/完成它 - How to hide my application but not close/finish it 我无法在我的应用程序中打开google maps - i am not able to open google maps within my application 为什么我能够关闭套接字但无法连接到 Android 中的设备? - Why I am able to close socket but not able to connect to device in Android? 如果我关闭我的应用程序,服务将关闭 - Service will close if i close my application 我是否能够在第一次运行应用程序时使用android服务器 - am I able to use android serives in the first time I run my application 我无法在Android应用程序中使用RestApi - I am not able to use RestApi in android application 我正在做一个简单的清单应用程序。我能够将数据保存到文件中,但是当我关闭应用程序并重新打开时,我正在丢失数据 - I'm making a simple to do list application.I am able to save the data to file but when I close the application and reopen i'm loosing the data Android应用程序设置为仅可在平板电脑上部署,但是为什么我仍然可以在手机上安装它? - Android application is set to be deployed on tablets only, but why am I still able to install it on my phone? 为什么在我的应用程序中查看图库时,我无法获得正确的文本值? - Why I am not able to getProper Text Value while Viewing Gallery in my application? 我无法使用内容提供商在android应用程序中更新我的电子邮件 - I am not able to update my email in android application using content provider
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM