本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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));
}
}
示例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);
}
}
示例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();
}