Search in sources :

Example 81 with SharedPreferences

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

the class MyScheduleModel method addDataObservers.

/**
     * Observe changes on base uri and in shared preferences
     */
private void addDataObservers() {
    mContext.getContentResolver().registerContentObserver(ScheduleContract.BASE_CONTENT_URI, true, mObserver);
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
    sp.registerOnSharedPreferenceChangeListener(mPrefChangeListener);
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 82 with SharedPreferences

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

the class ConfMessageCardUtils method unregisterPreferencesChangeListener.

/**
     * Unregister a {@code listener} which is notified when these settings are changed.
     *
     * @param context A context that has the same lifecycle as the listener that will be returned.
     * @param listener Listener to unregister.
     */
public static void unregisterPreferencesChangeListener(final Context context, ConferencePrefChangeListener listener) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    sp.unregisterOnSharedPreferenceChangeListener(listener);
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 83 with SharedPreferences

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

the class ConfMessageCardUtils method markDismissedConfMessageCard.

/**
     * Mark that the user has dismissed one of the conference message cards so the app doesn't
     * show that card to them again.
     *
     * @param context Context to be used to lookup the {@link android.content.SharedPreferences}.
     * @param card    One of the ConfMessageCard enum values
     */
public static void markDismissedConfMessageCard(final Context context, ConfMessageCard card) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    sp.edit().putBoolean(card.getDismissedPreferenceKey(), true).apply();
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 84 with SharedPreferences

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

the class SettingsUtils method markConductAccepted.

/**
     * Mark {@code newValue whether} the user has accepted the Code of Conduct so the app doesn't ask again.
     *
     * @param context Context to be used to edit the {@link android.content.SharedPreferences}.
     * @param newValue New value that will be set.
     */
public static void markConductAccepted(final Context context, boolean newValue) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    sp.edit().putBoolean(PREF_CONDUCT_ACCEPTED, newValue).apply();
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 85 with SharedPreferences

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

the class SettingsUtils method setCurSyncInterval.

/**
     * Set a new interval for the data sync time.
     *
     * @param context  Context to be used to edit the {@link android.content.SharedPreferences}.
     * @param newValue New value that will be set.
     */
public static void setCurSyncInterval(final Context context, long newValue) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    sp.edit().putLong(PREF_CUR_SYNC_INTERVAL, newValue).apply();
}
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