app/src/main/java/com/amol/testlogin/HomePage.java
void logOutAlert(){
        //Delete sesion token and stored user credentials
        AlertDialog.Builder alertDialog = new AlertDialog.Builder(this,R.style.AlertDialog);
        alertDialog.setTitle("Confirmation")
                .setMessage("Are you sure, you want to Logout?")
                .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        finish();
                    }
                })
                .setNegativeButton("No", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        Log.d(TAG,"Welcome Back");
                    }
                }).show();

    }
/**Asks for confirmation before user logs out*/
Asks for confirmation before user logs out
Asks for confirmation before user logs out
void logOutAlert(){
        AlertDialog.Builder alertDialog = new AlertDialog.Builder(this,R.style.AlertDialog);
        alertDialog.setTitle("Confirmation")
                .setMessage("Are you sure, you want to Logout?")
                .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        finish();
                    }
                })
                .setNegativeButton("No", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        Log.d(TAG,"Welcome Back");
                    }
                }).show();
    }
void logOutAlert ( ) { AlertDialog . Builder alertDialog = new AlertDialog . Builder ( this , R . style . AlertDialog ) ; alertDialog . setTitle ( "Confirmation" ) . setMessage ( "Are you sure, you want to Logout?" ) . setPositiveButton ( "Yes" , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialogInterface , int i ) { finish ( ) ; } } ) . setNegativeButton ( "No" , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialogInterface , int i ) { Log . d ( TAG , "Welcome Back" ) ; } } ) . show ( ) ; }
Asks for confirmation before user logs out
Asks for confirmation before user logs out
//Delete sesion token and stored user credentials