user3218332 user3218332 - 1 year ago 136
Android Question

Exit android app on back pressed

I am building an Android App. How to exit an Android App when back is pressed. Android version is 2.3.3 and above. The Android App goes to previous activity which i don't want.

Answer Source

Yes, you can exit an Android App on back pressed. Just override the onBackPressed() method.

public void onBackPressed() {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download