Search in sources :

Example 91 with SharedPreferences

use of android.content.SharedPreferences in project android-instagram by markchang.

the class Utils method getUsername.

public static String getUsername(Context ctx) {
    SharedPreferences sharedPreferences = ctx.getSharedPreferences(PREFS_NAME, Activity.MODE_PRIVATE);
    Boolean loginValid = sharedPreferences.getBoolean("loginValid", false);
    if (loginValid) {
        return sharedPreferences.getString("username", null);
    } else {
        return null;
    }
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 92 with SharedPreferences

use of android.content.SharedPreferences in project android-instagram by markchang.

the class LoginActivity method clearCookies.

public void clearCookies() {
    // clear username/password in shared preferences
    SharedPreferences sharedPreferences = getSharedPreferences(Utils.PREFS_NAME, MODE_PRIVATE);
    SharedPreferences.Editor editor = sharedPreferences.edit();
    editor.clear();
    editor.putBoolean("loginValid", false);
    editor.commit();
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 93 with SharedPreferences

use of android.content.SharedPreferences in project JieCaoVideoPlayer by lipangit.

the class JCUtils method getSavedProgress.

public static int getSavedProgress(Context context, String url) {
    if (!JCVideoPlayer.SAVE_PROGRESS)
        return 0;
    SharedPreferences spn;
    spn = context.getSharedPreferences("JCVD_PROGRESS", Context.MODE_PRIVATE);
    return spn.getInt(url, 0);
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 94 with SharedPreferences

use of android.content.SharedPreferences in project LiveSDK-for-Android by liveservices.

the class LiveAuthClient method getCookieKeysFromPreferences.

private List<String> getCookieKeysFromPreferences() {
    SharedPreferences settings = getSharedPreferences();
    String cookieKeys = settings.getString(PreferencesConstants.COOKIES_KEY, "");
    return Arrays.asList(TextUtils.split(cookieKeys, PreferencesConstants.COOKIE_DELIMITER));
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 95 with SharedPreferences

use of android.content.SharedPreferences in project NotificationPeekPort by lzanita09.

the class AppList method updateQuietHour.

/**
     * Update quiet hour period.
     */
public void updateQuietHour() {
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mContext);
    String quietHourStr = preferences.getString(PreferenceKeys.PREF_QUIET_HOUR, PreferenceKeys.PREF_QUIET_HOUR_DEF);
    mQuietHour = QuietHour.createQuietHour(quietHourStr);
    Calendar calendar = Calendar.getInstance();
    calendar.set(Calendar.HOUR_OF_DAY, mQuietHour.getFromHour());
    calendar.set(Calendar.MINUTE, mQuietHour.getFromMin());
    mFromTime = calendar.getTimeInMillis();
    calendar.set(Calendar.HOUR_OF_DAY, mQuietHour.getToHour());
    calendar.set(Calendar.MINUTE, mQuietHour.getToMin());
    if (calendar.getTimeInMillis() < mFromTime) {
        calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1);
    }
    mToTime = calendar.getTimeInMillis();
}
Also used : SharedPreferences(android.content.SharedPreferences) Calendar(java.util.Calendar)

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