简体   繁体   中英

Android Alert Dialog Force Close

Is there any way to build an Alert Dialog with a Button "Force Close" that close the app?

Thanks

That depends on you activity life cycle. If you always finish your activities after starting a new one, you can simply create a dialog with one button and on click of the button, you simply call finish() and thats it.

A general "close the whole application" is not how the life cycle should be used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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