exit app android

Solutions on MaxInterview for exit app android by the best coders in the world

showing results for - "exit app android"
Erica
18 Jul 2016
1 @Override
2    public void onBackPressed() {
3        AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
4        alertDialogBuilder.setTitle("Exit Application?");
5        alertDialogBuilder
6                .setMessage("Click yes to exit!")
7                .setCancelable(false)
8                .setPositiveButton("Yes",
9                        new DialogInterface.OnClickListener() {
10                            public void onClick(DialogInterface dialog, int id) {
11                                moveTaskToBack(true);
12                                android.os.Process.killProcess(android.os.Process.myPid());
13                                System.exit(1);
14                            }
15                        })
16
17                .setNegativeButton("No", new DialogInterface.OnClickListener() {
18                    public void onClick(DialogInterface dialog, int id) {
19
20                        dialog.cancel();
21                    }
22                });
23
24        AlertDialog alertDialog = alertDialogBuilder.create();
25        alertDialog.show();
26    }
27
Karl
27 Oct 2016
1ActivityName.this.finish();
2android.os.Process.killProcess(android.os.Process.myPid());
3System.exit(0);
Melina
29 May 2016
1public void onBackPressed() {
2  moveTaskToBack(true);
3  android.os.Process.killProcess(android.os.Process.myPid());
4  System.exit(1);
5}
queries leading to this page
android app exithow to exit from app in android studioexit java androidhow to exit app android studioexit an android appexit in android studioandroid close appandroid method when close or finish applicationandroid do something on exitclose app android javakill a app using android codehow to close app in android programmaticallyexit from application androidandroid java close applicationhow to exit app in androidclose app programmatically androidclose the background app in the androidclose the app androidhow to exit the app in androidclose the android appandroid code to exit appexit app androidhow to close app in androidexit application android close apps on androidclose exit application android app how to close applications on androidhow to exit from android app programmaticallyclose app android studiohow to exit an app in android studioexit from app java androidhow to exit the app in android studiohow ot close application android studioandroid exit codehow to code an application exit in android studio using javahow to exit android app how to close app from backgtound on androidhow close application java androidclose an app on android studioapp exit androidexit app java androidmanually exit application androidhow to close app androidandroid studio close app javaexit application android studioclose app completely in android codeclose app in androidexit app in android studioclose the app also in the backgroundandroid studio close app completely exit buttonclose app java android studioexit app android studioandroid java close appandroid close application codeexit from programmicallyandroid java exitexit the app androidmake the program do something on exit android studioexit program androidquit android app programmaticallyclose app androidandroid exit app completelyhow to exit app in android studioclose android appandroid close app javahow to exit application in androidandroid exit appcode exit program android studioandroid on application closeandroid on app closeandroid studio quit applicationexit exit androidandroid how to close app from application classexit from app android studiointent exit applicationandroid exit applicationclose app code androidandroid quit apphow to implement app exit in androidexit app in androidexit application android programmaticallyclose application in android studioandroid studio close appandroid studio exit appandroid close applicationclose app completely androidandroid how to close app exit app android