Java Code Examples for android.widget.ArrayAdapter.notifyDataSetChanged()

The following are Jave code examples for showing how to use notifyDataSetChanged() of the android.widget.ArrayAdapter class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: WiFiSDCryptoLocker   File: WifiScanReceiver.java   Source Code and License Vote up 6 votes
@SuppressLint("UseValueOf")
public void onReceive(Context c, Intent intent) {
    ArrayAdapter arrayAdapter = crossfadePageTransformer.getAdapter();
    if (arrayAdapter != null) {
        arrayAdapter.clear();
        arrayAdapter.addAll(getWifiNetworks());
        arrayAdapter.notifyDataSetChanged();
    }
}
 
Example 2
Project: bluewatcher   File: GenericAppEditorActivity.java   Source Code and License Vote up 5 votes
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();
}
 
Example 3
Project: encdroidMC   File: ConfigSyncActivity.java   Source Code and License Vote up 4 votes
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);
	}