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


Java ArrayAdapter.notifyDataSetChanged方法代碼示例

本文整理匯總了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();
    }
}
 
開發者ID:ProjektMedInf,項目名稱:WiFiSDCryptoLocker,代碼行數:10,代碼來源:WifiScanReceiver.java

示例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();
}
 
開發者ID:masterjc,項目名稱:bluewatcher,代碼行數:9,代碼來源:GenericAppEditorActivity.java

示例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);
	}
 
開發者ID:starn,項目名稱:encdroidMC,代碼行數:59,代碼來源:ConfigSyncActivity.java


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