Code example for ArrayAdapter

Methods: notifyDataSetChanged

0
	private void updateDirectory() { 
		m_subdirs.clear();
		m_subdirs.addAll(getDirectories(m_dir));
		m_titleView.setText(m_dir);
 
		m_listAdapter.notifyDataSetChanged();
	} 
 
	private ArrayAdapter<String> createListAdapter(List<String> items) {
		return new ArrayAdapter<String>(m_context,
				android.R.layout.select_dialog_item, android.R.id.text1, items) {
			@Override 
			public View getView(int position, View convertView, ViewGroup parent) {
				View v = super.getView(position, convertView, parent);
 
				if (v instanceof TextView) {
					// Enable list item (directory) text wrapping 
					TextView tv = (TextView) v;
					tv.getLayoutParams().height = LayoutParams.WRAP_CONTENT;
					tv.setTextColor(Color.WHITE);
					tv.setEllipsize(null);