本文整理匯總了Java中android.widget.ArrayAdapter.notifyDataSetChanged方法的典型用法代碼示例。如果您正苦於以下問題:Java ArrayAdapter.notifyDataSetChanged方法的具體用法?Java ArrayAdapter.notifyDataSetChanged怎麽用?Java ArrayAdapter.notifyDataSetChanged使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.ArrayAdapter
的用法示例。
在下文中一共展示了ArrayAdapter.notifyDataSetChanged方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onReceive
import android.widget.ArrayAdapter; //導入方法依賴的package包/類
@SuppressLint("UseValueOf")
public void onReceive(Context c, Intent intent) {
ArrayAdapter arrayAdapter = crossfadePageTransformer.getAdapter();
if (arrayAdapter != null) {
arrayAdapter.clear();
arrayAdapter.addAll(getWifiNetworks());
arrayAdapter.notifyDataSetChanged();
}
}
示例2: reloadHeaderFiltersList
import android.widget.ArrayAdapter; //導入方法依賴的package包/類
private void reloadHeaderFiltersList() {
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this.getBaseContext(), android.R.layout.simple_list_item_1);
for (String filter : appConfiguration.getMessageFilters()) {
adapter.add(filter);
}
headerFiltersList.setAdapter(adapter);
adapter.notifyDataSetChanged();
}
示例3: refresh
import android.widget.ArrayAdapter; //導入方法依賴的package包/類
private void refresh(String selectedLocalPathToSync){
EDApplication mApp = (EDApplication) getApplication();
syncRules = mApp.getDbHelper().getSyncRules();
int i = 0;
int selectedPosition = 0;
String volumeNameValue = "";
String volumePathValue = "";
if (getIntent() != null && getIntent().getExtras() != null ){
volumeNameValue = getIntent().getExtras().getString("volumeName");
volumePathValue = getIntent().getExtras().getString("volumePath");
}
volumeName.setText(volumeNameValue);
volumePath.setText(volumePathValue);
password.setText("");
onlyWifiCheckBox.setChecked(true);
removeAfterCheckBox.setChecked(false);
localFolder.setText("");
syncID.setText("-1");
// if ("".equals(volumeNameValue)){
// rules=new String[syncRules.size()];
// } else {
// rules=new String[syncRules.size()+1];
// rules[0] = "New rule";
// i++;
// }
rules=new String[syncRules.size()+1];
rules[0] = "New rule";
i++;
maxID = 0;
for (FileSynchronizerRule rule: syncRules){
rules[i]=rule.getLocalPathToSync();
if ((selectedLocalPathToSync==null && i==0) || (selectedLocalPathToSync != null && selectedLocalPathToSync.equals(rule.getLocalPathToSync()))){
selectedPosition=i;
volumeName.setText(rule.getVolumeNameToSync());
volumePath.setText(rule.getVolumePathToSync());
password.setText(rule.getVolumePassword());
onlyWifiCheckBox.setChecked(new Boolean(rule.getSyncOnlyOnWifi()));
removeAfterCheckBox.setChecked( new Boolean(rule.getDeleteSrcFileAfterSync()));
localFolder.setText(rule.getLocalPathToSync());
syncID.setText(""+rule.getId());
if (rule.getId()>maxID) maxID = rule.getId();
}
i++;
}
ArrayAdapter<String> adapter=new ArrayAdapter<String>(ConfigSyncActivity.this, android.R.layout.simple_spinner_item, rules);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spin1.setAdapter(adapter);
adapter.notifyDataSetChanged();
userSelect=false;
if (spin1.getSelectedItemPosition() != selectedPosition) spin1.setSelection(selectedPosition);
}