Java tutorial
//package com.java2s; import android.content.Context; public class Main { private static final String PREFERENCE_AUTHORIZED_KEY = "isAuthorized"; private static final String LOGIN_PREFERENCE = "loginData"; public static void logout(Context context) { context.getSharedPreferences(LOGIN_PREFERENCE, Context.MODE_PRIVATE).edit() .putBoolean(PREFERENCE_AUTHORIZED_KEY, false).apply(); } }