• Android-Logout (Clear Activity history stack)





    Android- On logout, clear Activity history stack, preventing “back” button from opening logged-in-only Activities


    Intent intent = new Intent(this, LoginActivity.class);
    intent.putExtra("finish", true); // if you are checking for this in your other Activities
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | 
                    Intent.FLAG_ACTIVITY_CLEAR_TASK |
                    Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(intent);
    finish();
  • 0 comments:

    Post a Comment

    FAVOURITE LINE

    To steal ideas from one is plagiarism. To steal from many is Research.

    ADDRESS

    Mumbai , Maharashtra

    EMAIL

    shikha.pathak6@gmail.com
    shikha.the.swt.pari@gmail.com

    Skype

    shikha_pari