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


Java PreferenceCategory.removeAll方法代碼示例

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


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

示例1: updateSelfHostedBlogsPreferenceCategory

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
/**
 * Update the "wpcom blogs" preference category to contain a preference for each blog to configure
 * blog-specific settings.
 */
void updateSelfHostedBlogsPreferenceCategory() {
    PreferenceCategory blogsCategory = (PreferenceCategory) findPreference(getActivity().getString(R.string.pref_key_self_hosted));
    blogsCategory.removeAll();
    int order = 0;

    // Add self-hosted blog button
    Preference addBlogPreference = new Preference(getActivity());
    addBlogPreference.setTitle(R.string.add_self_hosted_blog);
    Intent intentWelcome = new Intent(getActivity(), SignInActivity.class);
    intentWelcome.putExtra(SignInActivity.START_FRAGMENT_KEY, SignInActivity.ADD_SELF_HOSTED_BLOG);
    addBlogPreference.setIntent(intentWelcome);
    addBlogPreference.setOrder(order++);
    blogsCategory.addPreference(addBlogPreference);

    // Add self hosted list
    List<Map<String, Object>> accounts = WordPress.wpDB.getAccountsBy("dotcomFlag=0", null);
    addAccounts(blogsCategory, accounts, order);
}
 
開發者ID:ldsddn,項目名稱:wordpress_app_android,代碼行數:23,代碼來源:SettingsFragment.java

示例2: addPreferenceScreenSensors

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
protected void addPreferenceScreenSensors() {
    ArrayList<DataSource> dataSources = null;
    try {
        dataSources = Configuration.getDataSources();
    } catch (FileNotFoundException e) {
        return;
    }
    String dataSourceType, platformId, dataSourceId, platformType, deviceId;
    PreferenceCategory preferenceCategory = (PreferenceCategory) findPreference("dataSourceType");
    preferenceCategory.removeAll();
    for (int i = 0; i < dataSources.size(); i++) {
        platformId = dataSources.get(i).getPlatform().getId();
        dataSourceType = dataSources.get(i).getType();
        dataSourceId = dataSources.get(i).getId();
        platformType = dataSources.get(i).getPlatform().getType();
        deviceId = dataSources.get(i).getPlatform().getMetadata().get(METADATA.DEVICE_ID);
        Preference preference = createPreference(dataSourceType, dataSourceId, platformType, platformId, deviceId);
        preferenceCategory.addPreference(preference);
    }
}
 
開發者ID:MD2Korg,項目名稱:mCerebrum-AutoSense,代碼行數:21,代碼來源:PrefsFragmentPlot.java

示例3: emptyAndHidePreferenceCategory

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
private void emptyAndHidePreferenceCategory(int preferenceKey) {
	Preference preference = findPreference(getString(preferenceKey));
	if (!(preference instanceof PreferenceCategory))
		return;

	PreferenceCategory preferenceCategory = (PreferenceCategory) preference;
	preferenceCategory.removeAll();
	hidePreference(preferenceCategory);
}
 
開發者ID:treasure-lau,項目名稱:Linphone4Android,代碼行數:10,代碼來源:SettingsFragment.java

示例4: initAccounts

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
private void initAccounts() {
	PreferenceCategory accounts = (PreferenceCategory) findPreference(getString(R.string.pref_sipaccounts_key));
	accounts.removeAll();

	// Get already configured extra accounts
	int defaultAccountID = mPrefs.getDefaultAccountIndex();
	int nbAccounts = mPrefs.getAccountCount();
	for (int i = 0; i < nbAccounts; i++) {
		final int accountId = i;
		// For each, add menus to configure it
		String username = mPrefs.getAccountUsername(accountId);
		String domain = mPrefs.getAccountDomain(accountId);
		LedPreference account = new LedPreference(getActivity());

		if (username == null) {
			account.setTitle(getString(R.string.pref_sipaccount));
		} else {
			account.setTitle(username + "@" + domain);
		}

		if (defaultAccountID == i) {
			account.setSummary(R.string.default_account_flag);
		}

		account.setOnPreferenceClickListener(new OnPreferenceClickListener()
		{
			public boolean onPreferenceClick(Preference preference) {
				LinphoneActivity.instance().displayAccountSettings(accountId);
				return false;
			}
		});
		updateAccountLed(account, username, domain, mPrefs.isAccountEnabled(i));
		accounts.addPreference(account);
	}
}
 
開發者ID:treasure-lau,項目名稱:Linphone4Android,代碼行數:36,代碼來源:SettingsFragment.java

示例5: resetList

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
private void resetList(String preferenceCategoryKey) {
    PreferenceCategory profileCategory =
            (PreferenceCategory) getPreferenceScreen().findPreference(preferenceCategoryKey);
    if (profileCategory != null) {
        profileCategory.removeAll();
        getPreferenceScreen().removePreference(profileCategory);
    }

    mEmptyView.setVisibility(View.GONE);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:11,代碼來源:SavePasswordsPreferences.java

示例6: hideGPSCategory

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
private void hideGPSCategory() {
    PreferenceScreen preferenceScreen = getPreferenceScreen();
    PreferenceCategory preferenceCategory = (PreferenceCategory) findPreference(getResources().getString(R.string.pref_gps_category));
    if (preferenceCategory != null) {
        preferenceCategory.removeAll();
        preferenceScreen.removePreference((Preference) preferenceCategory);
    }
}
 
開發者ID:once2go,項目名稱:mvp.recar.io,代碼行數:9,代碼來源:ConfigActivity.java

示例7: refreshWPComAuthCategory

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
public void refreshWPComAuthCategory() {
    PreferenceCategory wpComCategory = (PreferenceCategory) findPreference(getActivity().getString(R.string.pref_key_wpcom));
    wpComCategory.removeAll();
    addWpComSignIn(wpComCategory, 0);
    addWpComShowHideButton(wpComCategory, 5);
    List<Map<String, Object>> accounts = WordPress.wpDB.getAccountsBy("dotcomFlag = 1 AND isHidden = 0", null);
    addAccounts(wpComCategory, accounts, 10);
}
 
開發者ID:ldsddn,項目名稱:wordpress_app_android,代碼行數:9,代碼來源:SettingsFragment.java

示例8: addPreferenceScreenSensors

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
protected void addPreferenceScreenSensors() {
    String dataSourceType;
    PreferenceCategory preferenceCategory = (PreferenceCategory) findPreference("dataSourceType");
    preferenceCategory.removeAll();
    for (int i = 0; i < phoneSensorDataSources.getPhoneSensorDataSources().size(); i++) {
        dataSourceType = phoneSensorDataSources.getPhoneSensorDataSources().get(i).getDataSourceType();
        SwitchPreference switchPreference = createSwitchPreference(dataSourceType);
        preferenceCategory.addPreference(switchPreference);
    }
}
 
開發者ID:MD2Korg,項目名稱:mCerebrum-PhoneSensor,代碼行數:11,代碼來源:PrefsFragmentSettings.java

示例9: addPreferenceScreenSensors

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
protected void addPreferenceScreenSensors() {
    String dataSourceType;
    PreferenceCategory preferenceCategory = (PreferenceCategory) findPreference("dataSourceType");
    preferenceCategory.removeAll();
    for (int i = 0; i < phoneSensorDataSources.getPhoneSensorDataSources().size(); i++) {
        dataSourceType = phoneSensorDataSources.getPhoneSensorDataSources().get(i).getDataSourceType();
        if(!phoneSensorDataSources.getPhoneSensorDataSources().get(i).isEnabled()) continue;
        Preference preference = createPreference(dataSourceType);
        preferenceCategory.addPreference(preference);
    }
}
 
開發者ID:MD2Korg,項目名稱:mCerebrum-PhoneSensor,代碼行數:12,代碼來源:PrefsFragmentPlot.java

示例10: setConfiguredLocation

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
void setConfiguredLocation() {
    PreferenceCategory pc = (PreferenceCategory) findPreference("key_configured_location");
    pc.removeAll();
    for (int i = 0; i < geoFenceData.getGeoFenceLocationInfos().size(); i++) {
        Preference p = new Preference(getActivity());
        String l = geoFenceData.getGeoFenceLocationInfos().get(i).getLocation();
        String lo = String.valueOf(geoFenceData.getGeoFenceLocationInfos().get(i).getLongitude());
        String la = String.valueOf(geoFenceData.getGeoFenceLocationInfos().get(i).getLatitude());
        p.setKey(l);
        p.setTitle(l);
        p.setSummary("(Latitude: " + la + ", Longitude: " + lo+")");
        p.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
            @Override
            public boolean onPreferenceClick(final Preference preference) {
                Dialog.simple(getActivity(), "Delete Location", "Delete location = " + preference.getKey() + "?", "Yes", "Cancel", new DialogCallback() {
                    @Override
                    public void onSelected(String value) {
                        if ("Yes".equals(value)) {
                            geoFenceData.delete(preference.getKey());
                            createPreferenceScreen();
                        }
                    }
                }).show();
                return true;
            }
        });
        pc.addPreference(p);
    }
}
 
開發者ID:MD2Korg,項目名稱:mCerebrum-PhoneSensor,代碼行數:30,代碼來源:PrefsFragmentSettingsGeofence.java

示例11: resetList

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
private void resetList(String preferenceCategoryKey) {
    PreferenceCategory profileCategory =
            (PreferenceCategory) getPreferenceScreen().findPreference(preferenceCategoryKey);
    if (profileCategory != null) {
        profileCategory.removeAll();
        getPreferenceScreen().removePreference(profileCategory);
    }
}
 
開發者ID:mogoweb,項目名稱:365browser,代碼行數:9,代碼來源:SavePasswordsPreferences.java

示例12: setupAppInstall

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
private void setupAppInstall() {
    PreferenceCategory preferenceCategory = (PreferenceCategory) findPreference("key_app");
    preferenceCategory.removeAll();
    for (int i = 0; i < appInstallManager.getAppInstallList().size(); i++) {
        ListPreference listPreference = new ListPreference(getActivity());
        listPreference.setTitle(appInstallManager.getAppInstallList().get(i).getName());
        listPreference.setKey(appInstallManager.getAppInstallList().get(i).getName());
        setEntries(listPreference, appInstallManager.getAppInstallList().get(i));
        final int finalI = i;
        listPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
            @Override
            public boolean onPreferenceChange(Preference preference, Object newValue) {
                if (newValue.equals("Install") || newValue.equals("Update")) {
                    appInstallManager.install(getActivity(), finalI, onCompletionListener);

                } else if (newValue.equals("Run")) {
                    appInstallManager.getAppInstallList().get(finalI).run(context);
                } else if (newValue.equals("Uninstall")) {
                    appInstallManager.uninstall(finalI,onCompletionListener);
                } else if(newValue.equals("Permission")){
                    appInstallManager.permission(finalI,onCompletionListener);
                }
                return false;
            }
        });
        preferenceCategory.addPreference(listPreference);
        updatePreference(appInstallManager.getAppInstallList().get(i));
    }
}
 
開發者ID:MD2Korg,項目名稱:mCerebrum-Study,代碼行數:30,代碼來源:PrefsFragmentInstallApp.java

示例13: setupPreferenceScreenConfigured

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
private void setupPreferenceScreenConfigured() {
    PreferenceCategory category = (PreferenceCategory) findPreference("autosense_configured");
    category.removeAll();
    for (int i = 0; i < autoSensePlatforms.size(); i++) {
        Preference preference = new Preference(getActivity());
        preference.setIcon(R.drawable.ic_chest_teal_48dp);

        preference.setTitle(autoSensePlatforms.get(i).getDeviceId());
        preference.setSummary(autoSensePlatforms.get(i).getPlatformId());
        preference.setKey(autoSensePlatforms.get(i).getDeviceId());
        preference.setOnPreferenceClickListener(configuredListener());
        category.addPreference(preference);
    }
}
 
開發者ID:MD2Korg,項目名稱:mCerebrum-AutoSense,代碼行數:15,代碼來源:PrefsFragmentSettings.java

示例14: clearNotificationApplications

import android.preference.PreferenceCategory; //導入方法依賴的package包/類
public void clearNotificationApplications() {
    Log.d(LOG_TAG, "Clearing listening apps");
    PreferenceCategory category = (PreferenceCategory) findPreference("preference_category_apps");
    category.removeAll();
    appManager.clearNotificationApplications();
}
 
開發者ID:jareddlc,項目名稱:OpenFit,代碼行數:7,代碼來源:OpenFitActivity.java


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