开发者

quit menu in the android

开发者 https://www.devze.com 2023-03-01 03:21 出处:网络
hello everyone i want to set the quit menu in my app . The problem i开发者_开发技巧 am facing by usingSystem.exit(0); it quit from the main acitivity but from the second activity when i press the quit

hello everyone i want to set the quit menu in my app . The problem i开发者_开发技巧 am facing by using System.exit(0); it quit from the main acitivity but from the second activity when i press the quit button it come to first activity .

By using moveTaskToBack(true) it works fine but when i start the app again it bring back the activity from which i was quited not the main activity . so please suggest me the how we can quit easily from it


You should probably not be using System.exit(0) in your application. Take a look at this awesome thread for more guidance on the topic of 'exiting' an Android application.


Try setting android:finishTaskOnLaunch=true in manifest file in every Activity Tag and check.

Hope it helps..

0

精彩评论

暂无评论...
验证码 换一张
取 消