Search in sources :

Example 71 with SharedPreferences

use of android.content.SharedPreferences in project iosched by google.

the class UIUtils method isNotificationFiredForBlock.

// Shows whether a notification was fired for a particular session time block. In the
// event that notification has not been fired yet, return false and set the bit.
public static boolean isNotificationFiredForBlock(Context context, String blockId) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    final String key = String.format("notification_fired_%s", blockId);
    boolean fired = sp.getBoolean(key, false);
    sp.edit().putBoolean(key, true).apply();
    return fired;
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 72 with SharedPreferences

use of android.content.SharedPreferences in project iosched by google.

the class AccountUtils method clearActiveAccount.

public static void clearActiveAccount(final Context context) {
    LOGD(TAG, "Clearing active account");
    SharedPreferences sp = getSharedPreferences(context);
    sp.edit().remove(PREF_ACTIVE_ACCOUNT).apply();
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 73 with SharedPreferences

use of android.content.SharedPreferences in project iosched by google.

the class AccountUtils method setPlusCoverUrl.

public static void setPlusCoverUrl(final Context context, final String accountName, String coverPhotoUrl) {
    SharedPreferences sp = getSharedPreferences(context);
    sp.edit().putString(makeAccountSpecificPrefKey(accountName, PREFIX_PREF_PLUS_COVER_URL), coverPhotoUrl).apply();
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 74 with SharedPreferences

use of android.content.SharedPreferences in project iosched by google.

the class AccountUtils method setPlusProfileId.

public static void setPlusProfileId(final Context context, final String accountName, final String profileId) {
    SharedPreferences sp = getSharedPreferences(context);
    sp.edit().putString(makeAccountSpecificPrefKey(accountName, PREFIX_PREF_PLUS_PROFILE_ID), profileId).apply();
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 75 with SharedPreferences

use of android.content.SharedPreferences in project iosched by google.

the class AccountUtils method setAuthToken.

public static void setAuthToken(final Context context, final String accountName, final String authToken) {
    LOGI(TAG, "Auth token of length " + (TextUtils.isEmpty(authToken) ? 0 : authToken.length()) + " for " + accountName);
    SharedPreferences sp = getSharedPreferences(context);
    sp.edit().putString(makeAccountSpecificPrefKey(accountName, PREFIX_PREF_AUTH_TOKEN), authToken).apply();
    LOGV(TAG, "Auth Token: " + authToken);
}
Also used : SharedPreferences(android.content.SharedPreferences)

Aggregations

SharedPreferences (android.content.SharedPreferences)1762 Intent (android.content.Intent)221 View (android.view.View)110 Editor (android.content.SharedPreferences.Editor)100 TextView (android.widget.TextView)74 ArrayList (java.util.ArrayList)67 Context (android.content.Context)59 PendingIntent (android.app.PendingIntent)57 File (java.io.File)57 IOException (java.io.IOException)56 Bundle (android.os.Bundle)45 JSONException (org.json.JSONException)41 JSONObject (org.json.JSONObject)41 DialogInterface (android.content.DialogInterface)37 AdapterView (android.widget.AdapterView)34 ImageView (android.widget.ImageView)34 ListView (android.widget.ListView)34 SuppressLint (android.annotation.SuppressLint)33 JSONArray (run.wallet.common.json.JSONArray)33 ComponentName (android.content.ComponentName)31