当前位置: 首页>>代码示例>>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;未经允许,请勿转载。