Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exit an Android app

Tags:

android

I have an android app where I check user credential in the first screen from a remote server. I have a timeout of 10 secs. After timeout app sends user to Error Page. There I have an Exit button.

I have tried writting all the logic for exiting the application including

android.os.Process.killProcess(android.os.Process.myPid()); 

in the click of exit button. But I am not able to ext from the application.

Please help me finding a way to exit the app.

like image 445
Bhabani Shankar Avatar asked Dec 07 '22 19:12

Bhabani Shankar


1 Answers

Why would the user want to exit the app just because the user entered the wrong credentials/dont have the right credentials?

If I were you, the error view/activity/"page" would offer a constructive solution to whatever problem brought the user there. There is not really any benefit for the user in simply saying "error" and then exiting the app.

As for your question, Google discourages implementing exit buttons. Android will "exit" your app when it sees fit and it is up to the developer to implement the correct behavior when this happens.

http://developer.android.com/guide/topics/fundamentals/activities.html

Is quitting an application frowned upon?

like image 147
fred Avatar answered Dec 21 '22 23:12

fred