Example usage for Java android.widget ListView fields, constructors, methods, implement or subclass
The text is from its open source code.
ListView(Context context) | |
ListView(Context context, AttributeSet attrs) | |
ListView(Context context, AttributeSet attrs, int defStyleAttr) |
void | addFooterView(View v) Add a fixed view to appear at the bottom of the list. |
void | addFooterView(View v, Object data, boolean isSelectable) Add a fixed view to appear at the bottom of the list. |
void | addHeaderView(View v) Add a fixed view to appear at the top of the list. |
void | addHeaderView(View v, Object data, boolean isSelectable) Add a fixed view to appear at the top of the list. |
void | clearChoices() Clear any choices previously set |
void | clearTextFilter() Clear the text filter. |
ListAdapter | getAdapter() Returns the adapter currently in use in this ListView. |
int | getCheckedItemCount() Returns the number of items currently selected. |
long[] | getCheckedItemIds() Returns the set of checked items ids. |
int | getCheckedItemPosition() Returns the currently checked item. |
SparseBooleanArray | getCheckedItemPositions() Returns the set of checked items in the list. |
long[] | getCheckItemIds() Returns the set of checked items ids. |
int | getChoiceMode() |
Class> | getClass() Returns the runtime class of this Object . |
int | getDividerHeight() |
int | getFooterViewsCount() |
int | getHeaderViewsCount() |
int | getListPaddingBottom() List padding is the maximum of the normal view's padding and the padding of the selector. |
int | getListPaddingLeft() List padding is the maximum of the normal view's padding and the padding of the selector. |
int | getListPaddingRight() List padding is the maximum of the normal view's padding and the padding of the selector. |
int | getListPaddingTop() List padding is the maximum of the normal view's padding and the padding of the selector. |
View | getSelectedView() |
int | getTranscriptMode() Returns the current transcript mode. |
void | invalidateViews() Causes all the views to be rebuilt and redrawn. |
boolean | isItemChecked(int position) Returns the checked state of the specified position. |
void | onRestoreInstanceState(Parcelable state) |
Parcelable | onSaveInstanceState() |
boolean | performItemClick(View view, int position, long id) |
boolean | removeFooterView(View v) Removes a previously-added footer view. |
boolean | removeHeaderView(View v) Removes a previously-added header view. |
void | requestLayout() |
void | setAdapter(ListAdapter adapter) Sets the data behind this ListView. |
void | setCacheColorHint(int color) |
void | setChoiceMode(int choiceMode) Defines the choice behavior for the List. |
void | setDivider(@Nullable Drawable divider) Sets the drawable that will be drawn between each item in the list. |
void | setDividerHeight(int height) Sets the height of the divider that will be drawn between each item in the list. |
void | setDrawSelectorOnTop(boolean onTop) Controls whether the selection highlight drawable should be drawn on top of the item or behind it. |
void | setFastScrollAlwaysVisible(final boolean alwaysShow) Set whether or not the fast scroller should always be shown in place of the standard scroll bars. |
void | setFastScrollEnabled(final boolean enabled) Specifies whether fast scrolling is enabled or disabled. |
void | setFilterText(String filterText) Sets the initial value for the text filter. |
void | setFooterDividersEnabled(boolean footerDividersEnabled) Enables or disables the drawing of the divider for footer views. |
void | setHeaderDividersEnabled(boolean headerDividersEnabled) Enables or disables the drawing of the divider for header views. |
void | setItemChecked(int position, boolean value) Sets the checked state of the specified position. |
void | setItemsCanFocus(boolean itemsCanFocus) Indicates that the views created by the ListAdapter can contain focusable items. |
void | setMultiChoiceModeListener(MultiChoiceModeListener listener) Set a MultiChoiceModeListener that will manage the lifecycle of the selection ActionMode . |
void | setOnScrollListener(OnScrollListener l) Set the listener that will receive notifications every time the list scrolls. |
void | setOverscrollFooter(Drawable footer) Sets the drawable that will be drawn below all other list content. |
void | setOverScrollMode(int mode) |
void | setRecyclerListener(RecyclerListener listener) Sets the recycler listener to be notified whenever a View is set aside in the recycler for later reuse. |
void | setScrollBarStyle(int style) |
void | setScrollingCacheEnabled(boolean enabled) Enables or disables the children's drawing cache during a scroll. |
void | setSelection(int position) Sets the currently selected item. |
void | setSelectionFromTop(int position, int y) Sets the selected item and positions the selection y pixels from the top edge of the ListView. |
void | setSelector(@DrawableRes int resID) Set a Drawable that should be used to highlight the currently selected item. |
void | setSmoothScrollbarEnabled(boolean enabled) When smooth scrollbar is enabled, the position and size of the scrollbar thumb is computed based on the number of visible pixels in the visible items. |
void | setStackFromBottom(boolean stackFromBottom) When stack from bottom is set to true, the list fills its content starting from the bottom of the view. |
void | setTextFilterEnabled(boolean textFilterEnabled) Enables or disables the type filter window. |
void | setTranscriptMode(int mode) Puts the list or grid into transcript mode. |
void | setVelocityScale(float scale) Sets a scale factor for the fling velocity. |
void | setVerticalScrollbarPosition(int position) |
boolean | showContextMenuForChild(View originalView) |
void | smoothScrollBy(int distance, int duration) Smoothly scroll by distance pixels over duration milliseconds. |
void | smoothScrollToPosition(int position) Smoothly scroll to the specified adapter position. |
void | smoothScrollToPositionFromTop(int position, int offset, int duration) Smoothly scroll to the specified adapter position. |
void | smoothScrollToPositionFromTop(int position, int offset) Smoothly scroll to the specified adapter position. |