user3218332 user3218332 - 2 months ago 20
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.


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

public void onBackPressed() {