Jul 20, 2021

Double back press exit from app In Android Studio - Androidpro.in

Double back press exit from app

Add In Your java file activity main.java

Paste this code up to last closing brasher

boolean doubleBackToExitPressedOnce = false;
    public void onBackPressed() {
        if (doubleBackToExitPressedOnce) {
        this.doubleBackToExitPressedOnce = true;
        Toast.makeText(this, "Please click BACK again to exit", Toast.LENGTH_SHORT).show();
        new Handler().postDelayed(new Runnable() {
            public void run() {
        }, 2000);


Whatsapp Button works on Mobile Device only