Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Logout parse.com android

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 561
    Comment on it

    When we login through parse.com so at the time of logout, we need to clear the current user.

    We need to simple use method logOut() of parse.

    Below is the code

    ParseUser.logOut();
    ParseUser currentUser = ParseUser.getCurrentUser(); // Now this will be null

    I do it at when we clear the SharedPreference and go to Splash screen like this

    ParseUser.logOut();
     SharedPreferences accessTokenSharedPref = getActivity().getApplicationContext().getSharedPreferences(SharedPreferenceManager.USER_INFO, 0); SharedPreferences.Editor accessTokenEditor = accessTokenSharedPref.edit(); accessTokenEditor.clear();
     accessTokenEditor.commit(); 
    Intent intent = new Intent(getActivity(), SplashScreenActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(intent); getActivity().finish();

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: