當前位置: 首頁>>代碼示例>>Java>>正文


Java Editor.remove方法代碼示例

本文整理匯總了Java中android.content.SharedPreferences.Editor.remove方法的典型用法代碼示例。如果您正苦於以下問題:Java Editor.remove方法的具體用法?Java Editor.remove怎麽用?Java Editor.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.content.SharedPreferences.Editor的用法示例。


在下文中一共展示了Editor.remove方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: record

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
/**
 * Record the precache event. The event is persisted in shared preferences if the native library
 * is not loaded. If library is loaded, the event will be recorded as UMA metric, and any prior
 * persisted events are recorded to UMA as well.
 * @param event the precache event.
 */
public static void record(int event) {
    SharedPreferences sharedPreferences = ContextUtils.getAppSharedPreferences();
    long persistent_metric = sharedPreferences.getLong(PREF_PERSISTENCE_METRICS, 0);
    Editor preferencesEditor = sharedPreferences.edit();

    if (LibraryLoader.isInitialized()) {
        RecordHistogram.recordEnumeratedHistogram(
                EVENTS_HISTOGRAM, Event.getBitPosition(event), Event.EVENT_END);
        for (int e : Event.getEventsFromBitMask(persistent_metric)) {
            RecordHistogram.recordEnumeratedHistogram(
                    EVENTS_HISTOGRAM, Event.getBitPosition(e), Event.EVENT_END);
        }
        preferencesEditor.remove(PREF_PERSISTENCE_METRICS);
    } else {
        // Save the metric in preferences.
        persistent_metric = Event.addEventToBitMask(persistent_metric, event);
        preferencesEditor.putLong(PREF_PERSISTENCE_METRICS, persistent_metric);
    }
    preferencesEditor.apply();
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:27,代碼來源:PrecacheUMA.java

示例2: clearExpired

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
public boolean clearExpired(Date date) {
    boolean clearedAny = false;
    Editor prefsWriter = this.cookiePrefs.edit();
    for (Entry<String, Cookie> entry : this.cookies.entrySet()) {
        String name = (String) entry.getKey();
        if (((Cookie) entry.getValue()).isExpired(date)) {
            this.cookies.remove(name);
            prefsWriter.remove(COOKIE_NAME_PREFIX + name);
            clearedAny = true;
        }
    }
    if (clearedAny) {
        prefsWriter.putString(COOKIE_NAME_STORE, TextUtils.join(",", this.cookies.keySet()));
    }
    prefsWriter.commit();
    return clearedAny;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:18,代碼來源:PersistentCookieStore.java

示例3: clear

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
public void clear() {
    Editor prefsWriter = this.cookiePrefs.edit();
    for (String name : this.cookies.keySet()) {
        prefsWriter.remove(COOKIE_NAME_PREFIX + name);
    }
    prefsWriter.remove(COOKIE_NAME_STORE);
    prefsWriter.commit();
    this.cookies.clear();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:10,代碼來源:PersistentCookieStore.java

示例4: remove

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
public void remove( String... keys) {
	if (context != null && keys != null && keys.length > 0) {
		Editor editor = context.getSharedPreferences(USER_CONFING, Context.MODE_PRIVATE).edit();

		for (String keyItem : keys) {
			editor.remove(keyItem);
		}

		editor.apply();
	}
}
 
開發者ID:PlutoArchitecture,項目名稱:Pluto-Android,代碼行數:12,代碼來源:SharePreferenceUtils.java

示例5: removeTokenExpiresIn

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
public static void removeTokenExpiresIn(Context context, SHARE_MEDIA share_media) {
    if (context == null) {
        Log.w(TAG, "context is null when removing expires in");
        return;
    }
    Object keywordByPlatform = SocialSNSHelper.getKeywordByPlatform(share_media);
    if (TextUtils.isEmpty(keywordByPlatform)) {
        Log.w(TAG, "platform is null when save expires in ");
        return;
    }
    Editor edit = context.getSharedPreferences(SocializeConstants
            .SOCIAL_PREFERENCE_EXPIRE_IN, 0).edit();
    edit.remove(keywordByPlatform);
    edit.commit();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:16,代碼來源:OauthHelper.java

示例6: logoutFromTwitter

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
public void logoutFromTwitter() {
    stopListeningOnAKeyword();
    Editor e = mSharedPreferences.edit();
    e.remove(PREF_KEY_OAUTH_TOKEN);
    e.remove(PREF_KEY_OAUTH_SECRET);
    e.remove(PREF_KEY_TWITTER_LOGIN);
    e.remove(PREF_KEY_TWITTER_USERNAME);
    e.commit();
}
 
開發者ID:Dnet3,項目名稱:CustomAndroidOneSheeld,代碼行數:10,代碼來源:TwitterShield.java

示例7: wipePreferences

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
public static void wipePreferences(SharedPreferences pref, boolean userChanged) {
    Editor editor = pref.edit();
    if (!userChanged) {
        editor.remove(Trakt.KEY_TRAKT_USER);
        editor.remove(Trakt.KEY_TRAKT_SHA1);
        editor.remove(Trakt.KEY_TRAKT_LIVE_SCROBBLING);
        editor.remove(Trakt.KEY_TRAKT_SYNC_COLLECTION);
    }
    editor.remove(Trakt.KEY_TRAKT_SYNC_FLAG);
    editor.remove(Trakt.KEY_TRAKT_LAST_TIME_MOVIE_WATCHED);
    editor.remove(Trakt.KEY_TRAKT_LAST_TIME_SHOW_WATCHED);

    editor.commit();
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:15,代碼來源:Trakt.java

示例8: a

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
private void a(SharedPreferences sharedPreferences) {
    Editor edit = sharedPreferences.edit();
    edit.remove(a);
    edit.remove(b);
    edit.remove("a_start_time");
    edit.remove("a_end_time");
    edit.putString(f, "");
    edit.commit();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:10,代碼來源:aa.java

示例9: setAccessToken

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
public static void setAccessToken(SharedPreferences pref, String accessToken) {
    Editor editor = pref.edit();
    if (accessToken != null) {
        editor.putString(KEY_TRAKT_ACCESS_TOKEN, accessToken);
    } else {
        editor.remove(KEY_TRAKT_ACCESS_TOKEN);
    }
    editor.commit();
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:10,代碼來源:Trakt.java

示例10: clear

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
public void clear() {
    this.cookies.clear();
    Editor prefsWriter = this.cookiePrefs.edit();
    for (String name : this.cookies.keySet()) {
        prefsWriter.remove(new StringBuilder(COOKIE_NAME_PREFIX).append(name).toString());
    }
    prefsWriter.remove(COOKIE_NAME_STORE);
    prefsWriter.commit();
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:10,代碼來源:PersistentCookieStore.java

示例11: rmLoginInfo

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
public static synchronized void rmLoginInfo(Context context) {
    synchronized (LoginInfoHelp.class) {
        Editor edit = context.getSharedPreferences(SocializeConstants.SOCIAL_PREFERENCE_NAME,
                0).edit();
        edit.remove(SOCIALIZE_IDENTITY_INFO_KEY);
        edit.commit();
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:9,代碼來源:LoginInfoHelp.java

示例12: deleteRefreshToken

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
public static void deleteRefreshToken(Context context, SHARE_MEDIA share_media) {
    Editor edit = context.getSharedPreferences(SocializeConstants
            .SOCIAL_PREFERENCE_REFRESH_TOKEN, 0).edit();
    edit.remove(share_media.toString());
    edit.commit();
    edit = context.getSharedPreferences(SocializeConstants
            .SOCIAL_PREFERENCE_REFRESH_TOKEN_EXPIRES, 0).edit();
    edit.remove(share_media.toString());
    edit.commit();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:11,代碼來源:OauthHelper.java

示例13: remove

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
public  void remove(String key) {
    Editor edit = sharedPreferences.edit();
    edit.remove(key);
    edit.apply();
}
 
開發者ID:finddreams,項目名稱:AndroidMultiLanguage,代碼行數:6,代碼來源:CommSharedUtil.java

示例14: remove

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
public static boolean remove(String key)
{
	Editor editor = edit();
	editor.remove(key);
	return editor.commit();
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:7,代碼來源:CDKPreference.java

示例15: removeTemp

import android.content.SharedPreferences.Editor; //導入方法依賴的package包/類
public static boolean removeTemp(String key)
{
	Editor editor = editTemp();
	editor.remove(key);
	return editor.commit();
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:7,代碼來源:CDKPreference.java


注:本文中的android.content.SharedPreferences.Editor.remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。