Search in sources :

Example 41 with SharedPreferences

use of android.content.SharedPreferences in project glimmr by brk3.

the class PhotoStreamGridFragment method storeNewestPhotoId.

@Override
public void storeNewestPhotoId(Photo photo) {
    SharedPreferences prefs = mActivity.getSharedPreferences(Constants.PREFS_NAME, Context.MODE_PRIVATE);
    SharedPreferences.Editor editor = prefs.edit();
    editor.putString(KEY_NEWEST_PHOTOSTREAM_PHOTO_ID, photo.getId());
    editor.commit();
    if (BuildConfig.DEBUG)
        Log.d(getLogTag(), "Updated most recent photostream photo id to " + photo.getId());
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 42 with SharedPreferences

use of android.content.SharedPreferences in project glimmr by brk3.

the class GroupPoolGridFragment method storeNewestPhotoId.

@Override
public void storeNewestPhotoId(Photo photo) {
    SharedPreferences prefs = mActivity.getSharedPreferences(Constants.PREFS_NAME, Context.MODE_PRIVATE);
    SharedPreferences.Editor editor = prefs.edit();
    editor.putString(KEY_NEWEST_GROUPPOOL_PHOTO_ID, photo.getId());
    editor.commit();
    if (BuildConfig.DEBUG)
        Log.d(getLogTag(), "Updated most recent grouppool photo id to " + photo.getId());
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 43 with SharedPreferences

use of android.content.SharedPreferences in project glimmr by brk3.

the class FavoritesGridFragment method storeNewestPhotoId.

@Override
public void storeNewestPhotoId(Photo photo) {
    SharedPreferences prefs = mActivity.getSharedPreferences(Constants.PREFS_NAME, Context.MODE_PRIVATE);
    SharedPreferences.Editor editor = prefs.edit();
    editor.putString(KEY_NEWEST_FAVORITES_PHOTO_ID, photo.getId());
    editor.commit();
    if (BuildConfig.DEBUG)
        Log.d(getLogTag(), "Updated most recent favorites photo id to " + photo.getId());
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 44 with SharedPreferences

use of android.content.SharedPreferences in project glimmr by brk3.

the class StackViewWidgetConfigure method loadWidgetType.

public static int loadWidgetType(Context context) {
    SharedPreferences prefs = context.getSharedPreferences(Constants.PREFS_NAME, Context.MODE_PRIVATE);
    int widgetType = prefs.getInt(KEY_WIDGET_TYPE, -1);
    if (widgetType == -1) {
        Log.e(TAG, "No widgetType found in SharedPreferences (-1)");
        widgetType = WIDGET_TYPE_EXPORE;
    }
    return widgetType;
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 45 with SharedPreferences

use of android.content.SharedPreferences in project glimmr by brk3.

the class AppListener method scheduleAlarms.

@Override
public void scheduleAlarms(AlarmManager mgr, PendingIntent pendingIntent, Context context) {
    /* If notifications off, ensure alarms are cancelled and return */
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
    boolean enableNotifications = prefs.getBoolean(Constants.KEY_ENABLE_NOTIFICATIONS, false);
    if (!enableNotifications) {
        if (BuildConfig.DEBUG)
            Log.d(TAG, "Cancelling alarms");
        AppService.cancelAlarms(context);
        return;
    }
    mMinutes = getMinutes(context);
    mgr.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + mMinutes * 60 * 1000, mMinutes * 60 * 1000, pendingIntent);
    if (BuildConfig.DEBUG) {
        Log.d(TAG, String.format("Set alarms for %d minute intervals", mMinutes));
    }
}
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