Java android.widget ListView fields, constructors, methods, implement or subclass

Example usage for Java android.widget ListView fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.widget ListView.

The text is from its open source code.

Subclass

android.widget.ListView has subclasses.
Click this link to see all its subclasses.

Constructor

Method

voidaddFooterView(View v)
Add a fixed view to appear at the bottom of the list.
voidaddFooterView(View v, Object data, boolean isSelectable)
Add a fixed view to appear at the bottom of the list.
voidaddHeaderView(View v)
Add a fixed view to appear at the top of the list.
voidaddHeaderView(View v, Object data, boolean isSelectable)
Add a fixed view to appear at the top of the list.
voidclearChoices()
Clear any choices previously set
voidclearTextFilter()
Clear the text filter.
ListAdaptergetAdapter()
Returns the adapter currently in use in this ListView.
intgetCheckedItemCount()
Returns the number of items currently selected.
long[]getCheckedItemIds()
Returns the set of checked items ids.
intgetCheckedItemPosition()
Returns the currently checked item.
SparseBooleanArraygetCheckedItemPositions()
Returns the set of checked items in the list.
long[]getCheckItemIds()
Returns the set of checked items ids.
intgetChoiceMode()
ClassgetClass()
Returns the runtime class of this Object .
intgetDividerHeight()
intgetFooterViewsCount()
intgetHeaderViewsCount()
intgetListPaddingBottom()
List padding is the maximum of the normal view's padding and the padding of the selector.
intgetListPaddingLeft()
List padding is the maximum of the normal view's padding and the padding of the selector.
intgetListPaddingRight()
List padding is the maximum of the normal view's padding and the padding of the selector.
intgetListPaddingTop()
List padding is the maximum of the normal view's padding and the padding of the selector.
ViewgetSelectedView()
intgetTranscriptMode()
Returns the current transcript mode.
voidinvalidateViews()
Causes all the views to be rebuilt and redrawn.
booleanisItemChecked(int position)
Returns the checked state of the specified position.
voidonRestoreInstanceState(Parcelable state)
ParcelableonSaveInstanceState()
booleanperformItemClick(View view, int position, long id)
booleanremoveFooterView(View v)
Removes a previously-added footer view.
booleanremoveHeaderView(View v)
Removes a previously-added header view.
voidrequestLayout()
voidsetAdapter(ListAdapter adapter)
Sets the data behind this ListView.
voidsetCacheColorHint(int color)
voidsetChoiceMode(int choiceMode)
Defines the choice behavior for the List.
voidsetDivider(@Nullable Drawable divider)
Sets the drawable that will be drawn between each item in the list.
voidsetDividerHeight(int height)
Sets the height of the divider that will be drawn between each item in the list.
voidsetDrawSelectorOnTop(boolean onTop)
Controls whether the selection highlight drawable should be drawn on top of the item or behind it.
voidsetFastScrollAlwaysVisible(final boolean alwaysShow)
Set whether or not the fast scroller should always be shown in place of the standard scroll bars.
voidsetFastScrollEnabled(final boolean enabled)
Specifies whether fast scrolling is enabled or disabled.
voidsetFilterText(String filterText)
Sets the initial value for the text filter.
voidsetFooterDividersEnabled(boolean footerDividersEnabled)
Enables or disables the drawing of the divider for footer views.
voidsetHeaderDividersEnabled(boolean headerDividersEnabled)
Enables or disables the drawing of the divider for header views.
voidsetItemChecked(int position, boolean value)
Sets the checked state of the specified position.
voidsetItemsCanFocus(boolean itemsCanFocus)
Indicates that the views created by the ListAdapter can contain focusable items.
voidsetMultiChoiceModeListener(MultiChoiceModeListener listener)
Set a MultiChoiceModeListener that will manage the lifecycle of the selection ActionMode .
voidsetOnScrollListener(OnScrollListener l)
Set the listener that will receive notifications every time the list scrolls.
voidsetOverscrollFooter(Drawable footer)
Sets the drawable that will be drawn below all other list content.
voidsetOverScrollMode(int mode)
voidsetRecyclerListener(RecyclerListener listener)
Sets the recycler listener to be notified whenever a View is set aside in the recycler for later reuse.
voidsetScrollBarStyle(int style)
voidsetScrollingCacheEnabled(boolean enabled)
Enables or disables the children's drawing cache during a scroll.
voidsetSelection(int position)
Sets the currently selected item.
voidsetSelectionFromTop(int position, int y)
Sets the selected item and positions the selection y pixels from the top edge of the ListView.
voidsetSelector(@DrawableRes int resID)
Set a Drawable that should be used to highlight the currently selected item.
voidsetSmoothScrollbarEnabled(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.
voidsetStackFromBottom(boolean stackFromBottom)
When stack from bottom is set to true, the list fills its content starting from the bottom of the view.
voidsetTextFilterEnabled(boolean textFilterEnabled)
Enables or disables the type filter window.
voidsetTranscriptMode(int mode)
Puts the list or grid into transcript mode.
voidsetVelocityScale(float scale)
Sets a scale factor for the fling velocity.
voidsetVerticalScrollbarPosition(int position)
booleanshowContextMenuForChild(View originalView)
voidsmoothScrollBy(int distance, int duration)
Smoothly scroll by distance pixels over duration milliseconds.
voidsmoothScrollToPosition(int position)
Smoothly scroll to the specified adapter position.
voidsmoothScrollToPositionFromTop(int position, int offset, int duration)
Smoothly scroll to the specified adapter position.
voidsmoothScrollToPositionFromTop(int position, int offset)
Smoothly scroll to the specified adapter position.