Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.Context;
import android.content.SharedPreferences;

import android.preference.PreferenceManager;

public class Main {
    /**
     * Removes the authToken and account name from the SharedPreferences storage
     * @param applicationContext
     */
    public static void clearAuthToken(Context applicationContext) {
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(applicationContext);
        SharedPreferences.Editor editor = prefs.edit();

        editor.remove("GDOCS_AUTH_TOKEN");
        editor.remove("GDOCS_ACCOUNT_NAME");
        editor.commit();
    }
}