Best code examples for ListView setAdapter method (android.widget.ListView.setAdapter)

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

ListView setAdapter examples from Open Source projects
This code example shows how to use the following methods: addHeaderView, setAdapter, setEmptyView, setFocusable, setOnItemClickListener
92:	listView.addHeaderView(headerView()); 
-
94:	listView.setOnItemClickListener(this); 
-
97:	listView.setEmptyView(emptyView); 
-
101:	listView.setAdapter(adapter); 
102:	listView.setFocusable(true); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addFooterView, getFooterViewsCount, setAdapter, setSelection
119:	if (mListView.getFooterViewsCount() == 0) { 
120:	mListView.addFooterView(mLoadingView); 
121:	mListView.setAdapter(mAdapter); 
-
131:	mListView.setSelection(0); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getAdapter, setAdapter, setOnScrollListener, setOnTouchListener
42:	ListAdapter rightAdapter = rightListView.getAdapter(); 
-
50:	rightListView.setAdapter(rightAdapter); 
-
53:	rightListView.setOnTouchListener(this); 
-
55:	rightListView.setOnScrollListener(this); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setAdapter, getParent
43:	list.setAdapter(new SimpleListAdapter(this)); 
-
45:	((View) list.getParent()).setLayerType(View.LAYER_TYPE_HARDWARE, null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addFooterView, getFooterViewsCount, setAdapter, setSelection
132:	if (mListView.getFooterViewsCount() == 0) { 
133:	mListView.addFooterView(mLoadingView); 
134:	mListView.setAdapter(mAdapter); 
-
144:	mListView.setSelection(0); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setAdapter
43:	activityList.setAdapter(adapter); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addFooterView, getFooterViewsCount, setAdapter, setSelection
132:	if (mListView.getFooterViewsCount() == 0) { 
133:	mListView.addFooterView(mLoadingView); 
134:	mListView.setAdapter(mAdapter); 
-
144:	mListView.setSelection(0); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setAdapter
21:	ListAdapter adapter = new SimpleCursorAdapter(this, 
-
27:	getListView().setAdapter(adapter); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setAdapter, setEmptyView, setFocusable, setOnItemClickListener
88:	listView.setOnItemClickListener(this); 
-
92:	listView.setEmptyView(emptyView); 
-
98:	listView.setAdapter(adapter); 
99:	listView.setFocusable(true); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdapter, setOnItemClickListener
37:	ListView lv=new ListView(this); 
38:	lv.setAdapter(new DocksAdapter(this)); 
39:	lv.setOnItemClickListener(this); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdapter, setOnItemClickListener
85:	mListView.setAdapter(mAdapter); 
86:	mListView.setOnItemClickListener(this); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdapter, setItemsCanFocus, setChoiceMode, setItemChecked, setOnItemClickListener
517:	list.setAdapter(new ArrayAdapter<String>(this, 
-
519:	list.setChoiceMode(ListView.CHOICE_MODE_SINGLE); 
520:	list.setItemsCanFocus(false); 
521:	list.setOnItemClickListener( 
-
530:	list.setItemChecked(mSelectedItemIndex, true); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addFooterView, getFooterViewsCount, setAdapter, setSelection
139:	if (mListView.getFooterViewsCount() == 0) { 
140:	mListView.addFooterView(mLoadingView); 
141:	mListView.setAdapter(mAdapter); 
-
151:	mListView.setSelection(0); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setAdapter
52:	listAdapter = new SimpleAdapter(this, servers, android.R.layout.simple_list_item_1, new String[]{SERVER_NAME}, new int[]{android.R.id.text1}); 
53:	getListView().setAdapter(listAdapter); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdapter
105:	messageQueue.setAdapter(adapter); 
106:	registerForContextMenu(messageQueue); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getChildAt, setAdapter, setSelectionFromTop, getFirstVisiblePosition, setOnItemClickListener
202:	int position = view.getFirstVisiblePosition(); 
203:	View child = view.getChildAt(0); 
-
206:	view.setAdapter(this); 
207:	view.setOnItemClickListener(this); 
-
209:	view.setSelectionFromTop(position, top); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdapter, setLayerType
47:	list.setAdapter(new SimpleListAdapter(this)); 
48:	list.setLayerType(View.LAYER_TYPE_HARDWARE, null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdapter, setOnItemClickListener
61:	list.setOnItemClickListener(this); 
-
64:	list.setAdapter(mAdapter); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setDescendantFocusability, setAdapter, setDivider, setItemsCanFocus, setFastScrollEnabled
67:	list.setDivider(null); 
68:	list.setDescendantFocusability(ListView.FOCUS_BEFORE_DESCENDANTS); 
69:	list.setFastScrollEnabled(false); 
70:	list.setSmoothScrollbarEnabled(true); 
71:	list.setItemsCanFocus(false); 
72:	list.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL); 
-
75:	list.setAdapter(mAdapter); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addFooterView, getFooterViewsCount, setAdapter, setSelection
141:	if (mListView.getFooterViewsCount() == 0) { 
142:	mListView.addFooterView(mLoadingView); 
143:	mListView.setAdapter(mAdapter); 
-
153:	mListView.setSelection(0); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setAdapter, getParent
43:	list.setAdapter(new SimpleListAdapter(this)); 
-
45:	((View) list.getParent()).setLayerType(View.LAYER_TYPE_HARDWARE, null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdapter, getItemIdAtPosition, performItemClick, setOnItemClickListener
77:	mListOption.setAdapter(mAdapter); 
78:	mListOption.setOnItemClickListener(this); 
-
80:	mListOption.performItemClick(mListOption, 0, mListOption.getItemIdAtPosition(0)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getChildAt, setAdapter, setSelectionFromTop, getFirstVisiblePosition, setOnItemClickListener
239:	int position = view.getFirstVisiblePosition(); 
240:	View child = view.getChildAt(0); 
-
243:	view.setAdapter(this); 
244:	view.setOnItemClickListener(this); 
-
246:	view.setSelectionFromTop(position, top); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdapter, setLayerType
57:	list.setAdapter(new SimpleListAdapter(this)); 
58:	list.setLayerType(View.LAYER_TYPE_HARDWARE, p); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdapter
48:	agendaList.setAdapter(adapter); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter
74:	result = new ListView(context); 
-
77:	result.setAdapter(listAdapter); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, getContext
150:	list.getContext().getApplicationContext(), 
-
157:	list.setAdapter(numbers); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, setLayerType
51:	list.setAdapter(new SimpleListAdapter(this)); 
52:	list.setLayerType(View.LAYER_TYPE_HARDWARE, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, setOnItemClickListener, setVisibility
179:	mListView.setAdapter(adapter); 
-
181:	mListView.setOnItemClickListener(adapter.showOnMapOnItemClickListener()); 
-
184:	mListView.setVisibility(View.VISIBLE); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter
60:	listView.setAdapter(mListAdapter); 
Full Snippet Info
6
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: setAdapter, setOnItemClickListener
64:	listView.setAdapter(adapter); 
65:	listView.setOnItemClickListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter
24:	ListView listView = new ListView(getContext()); 
-
34:	listView.setAdapter(adapter); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, setDividerHeight
91:	rlListView.setDividerHeight(5); 
-
94:	rlListView.setAdapter(appAdapter); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, addView
125:	ListView listView = new ListView(context); 
-
129:	listView.setAdapter(adapter); 
-
131:	((ViewPager) container).addView(listView,0); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter
48:	mAdapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_2, c, from, to); 
-
50:	this.getListView().setAdapter(mAdapter); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter
25:	ListView listView = new ListView(getContext()); 
-
35:	listView.setAdapter(adapter); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, setView
46:	list = new ListView(context); 
47:	list.setAdapter(adapter); 
48:	dialogBuilder = new AlertDialog.Builder(context).setTitle(title).setView(list); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, setFocusable, setFocusableInTouchMode
121:	listView.setFocusable(true); 
122:	listView.setFocusableInTouchMode(true); 
123:	listView.setAdapter(adapter); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, setOnItemClickListener
122:	lvPods.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, _lvPods_arr)); 
123:	lvPods.setOnItemClickListener(new OnItemClickListener(){ 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, setView
46:	list = new ListView(context); 
47:	list.setAdapter(adapter); 
48:	dialogBuilder = new AlertDialog.Builder(context).setTitle(title).setView(list); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, setVisibility
67:	octoListView.setAdapter( listTweetArrayAdapter ); 
-
70:	octoListView.setVisibility( View.VISIBLE ); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, setOnItemClickListener
96:	list.setOnItemClickListener(this); 
-
99:	list.setAdapter(mAdapter); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, invalidate
25:	mList.setAdapter(listAdapter); 
26:	mList.invalidate(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, setOnScrollListener
51:	mListView.setAdapter(mAdapter); 
52:	mListView.setOnScrollListener(this); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter, setOnItemClickListener
316:	mExternalList.setAdapter(mExternalAdapter); 
-
318:	mExternalList.setOnItemClickListener( 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter
42:	SimpleAdapter listAdapter = new SimpleAdapter(this, mData, android.R.layout.simple_list_item_2, from ,to); 
43:	getListView().setAdapter(listAdapter); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter
28:	ArrayAdapter<String> mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, ACTIVITIES); 
29:	getListView().setAdapter(mAdapter); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter
23:	ListAdapter a = new SimpleCursorAdapter(this, 
-
29:	getListView().setAdapter(a); 
Full Snippet Info
5
CodeRank
Related ListView setAdapter Questions & Answers:
Other ListView setAdapter Examples
80:			adapter = new NavDrawerListAdapter(getApplicationContext(),
81:					navDrawerItems);
82:			mDrawerList.setAdapter(adapter);
83:	
84:			// enabling action bar app icon and behaving it as toggle button

Read More

56:			adapter = new NavDrawerListAdapter(getApplicationContext(),
57:					navDrawerItems);
58:			mDrawerList.setAdapter(adapter);
59:	
60:			// enabling action bar app icon and behaving it as toggle button

Read More

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:	        
45:	        /**

Read More

A view that shows items in a vertically scrolling list. The items come from the ListAd...
setAdapter Method Overview
Sets the data behind this ListView.
See Also
  • addFooterView
    Add a fixed view to appear at the bottom of the list.
  • getAdapter
    Returns the adapter currently in use in this ListView.
  • setDivider
    Sets the drawable that will be drawn between each item in the list.
  • setDividerHeight
    Sets the height of the divider that will be drawn between each item in the list.
  • setItemsCanFocus
    Indicates that the views created by the ListAdapter can contain focusable items.
  • setSelectionFromTop
    Sets the selected item and positions the selection y pixels from the top edge of the ListView.