Best code examples for Android ArrayAdapter class (android.widget.ArrayAdapter)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ArrayAdapter class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android ArrayAdapter examples from Open Source projects
This code example shows how to use the following methods: getCount, getItem, isEmpty
13:	ArrayAdapter<String> adapter = new ArrayAdapter<String>(getContext(), android.R.id.text1); 
-
19:	assertFalse(adapter.isEmpty()); 
20:	assertEquals(3, adapter.getCount()); 
21:	assertEquals("test1", adapter.getItem(0)); 
22:	assertEquals("test2", adapter.getItem(1)); 
23:	assertEquals("test3", adapter.getItem(2)); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getItem, insert, remove
41:	String oldTitle = this.headers.getItem(section); 
-
44:	this.headers.remove(oldTitle); 
45:	this.headers.insert(title, section); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods:
70:	setListAdapter(new ArrayAdapter<String>(HeaderFooterDemo.this, 
-
72:	list)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: add
26:	ArrayAdapter<String> adapter = new ArrayAdapter<String>(getContext(), 
-
28:	adapter.add("ListView 1 Item 1"); 
29:	adapter.add("ListView 1 Item 2"); 
30:	adapter.add("ListView 1 Item 3"); 
31:	adapter.add("ListView 1 Item 4"); 
32:	adapter.add("ListView 1 Item 5"); 
33:	adapter.add("ListView 1 Item 6"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: add
25:	ArrayAdapter<String> adapter = new ArrayAdapter<String>(getContext(), 
-
27:	adapter.add("ListView 2 Item 1"); 
28:	adapter.add("ListView 2 Item 2"); 
29:	adapter.add("ListView 2 Item 3"); 
30:	adapter.add("ListView 2 Item 4"); 
31:	adapter.add("ListView 2 Item 5"); 
32:	adapter.add("ListView 2 Item 6"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
27:	adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, bestFoods); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setDropDownViewResource
360:	ArrayAdapter<String> adapter = new ArrayAdapter<String>(cxt, 
-
362:	adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
42:	setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, testNames)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getItem
48:	listener.onFeedSelected(adapter.getItem(position)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
36:	android.R.layout.simple_list_item_1, mStrings)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setDropDownViewResource
53:	android.R.layout.simple_spinner_item, mGroupList); 
54:	mGroupAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: add, getCount
86:	if (BluetoothListDevicesActivity.this.mNewDevicesArrayAdapter.getCount() == 0) { 
87:	BluetoothListDevicesActivity.this.mNewDevicesArrayAdapter.add("No devices found!"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
37:	setListAdapter(new ArrayAdapter<String>(this, 
38:	android.R.layout.simple_list_item_1, options)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
72:	list)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addAll, clear
76:	listAdapter.clear(); 
77:	listAdapter.addAll(result); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: add
92:	adapter.add(feed); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getItem
44:	mgr.registerListener(this, adapter.getItem(position), 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: add
74:	adapter.add(v.getText().toString()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: add, sort
156:	this.headers.add(section); 
-
168:	headers.sort(comp); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCount
81:	if (adapter.getCount() > 0) showDropDown(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
26:	ListAdapter listAdapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, dataArray); 
27:	setListAdapter(listAdapter); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addAll, clear
76:	listAdapter.clear(); 
77:	listAdapter.addAll(result); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
32:	setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, options)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addAll, setDropDownViewResource
101:	ArrayAdapter<String> adapter = new ArrayAdapter<String>(context, android.R.layout.simple_spinner_item); 
102:	adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 
103:	adapter.addAll(field.getOptions()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdapter
27:	ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, ITEMS); 
28:	getListView().setAdapter(adapter); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
15:	android.R.layout.simple_list_item_1, new String[] { " First", " Second", " Third", " Fourth", " Fifth", " Sixth"})); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setDropDownViewResource
51:	new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, 
-
54:	.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
45:	ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
26:	mArrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items); 
27:	setListAdapter(mArrayAdapter); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getItem
77:	Tip tip = mAdapter.getItem(position); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
33:	new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, options)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: add
66:	mAdapter.add(text); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
77:	ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_2, android.R.id.text1, mSimpleListValues); 
-
80:	mHlvSimpleList.setAdapter(adapter); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: add
40:	this.headers.add(section); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getItem
150:	TagDescription description = mAdapter.getItem(position); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setDropDownViewResource
64:	ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, 
-
66:	adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
27:	setListAdapter(new ArrayAdapter<String>(this, R.layout.simple_list_item_1, menu)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: add
140:	public void onReceive(Context context, Intent intent) { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setListNavigationCallbacks
24:	getActionBar().setListNavigationCallbacks(new ArrayAdapter<String>(this, 0), null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
16:	setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, SAMPLES)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: add
29:	this.headers.add(section); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
35:	android.R.layout.simple_list_item_1, mStrings)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
18:	ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
18:	ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
16:	ArrayAdapter adapter = new ArrayAdapter<String>(this, 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
17:	ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, 
Full Snippet Info
6
CodeRank
Related Android ArrayAdapter Questions & Answers:
Other Android ArrayAdapter Examples
19:	        
20:	        // Binding resources Array to ListAdapter
21:	        this.setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, R.id.label, adobe_products));
22:	        
23:	    }

Read More

17:		
18:		// Listview Adapter
19:		ArrayAdapter<String> adapter;
20:		
21:		// Search EditText
-
40:	        
41:	        // Adding items to listview
42:	        adapter = new ArrayAdapter<String>(this, R.layout.list_item, R.id.product_name, products);
43:	        lv.setAdapter(adapter);       
44:

Read More

19:	        
20:	        // Binding resources Array to ListAdapter
21:	        this.setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, R.id.label, adobe_products));
22:	        
23:	        ListView lv = getListView();

Read More

See Code Examples for Android ArrayAdapter Methods: