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

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

Introduction

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

The text is from its open source code.

Subclass

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

Field

intITEM_VIEW_TYPE_IGNORE
The item view type returned by Adapter#getItemViewType(int) when the adapter does not want the item's view recycled.
intITEM_VIEW_TYPE_HEADER_OR_FOOTER
The item view type returned by Adapter#getItemViewType(int) when the item is a header or footer.
intINVALID_POSITION
Represents an invalid position.
longINVALID_ROW_ID
Represents an empty or invalid row id

Method

TgetAdapter()
Returns the adapter currently associated with this widget.
intgetBottom()
Bottom position of this view relative to its parent.
ViewgetChildAt(int index)
Returns the view at the specified position in the group.
intgetChildCount()
Returns the number of children in the group.
ContextgetContext()
Returns the context the view is running in, through which it can access the current theme, resources, etc.
intgetCount()
intgetFirstVisiblePosition()
Returns the position within the adapter's data set for the first item displayed on screen.
intgetId()
Returns this view's identifier.
ObjectgetItemAtPosition(int position)
Gets the data associated with the specified position in the list.
longgetItemIdAtPosition(int position)
intgetLastVisiblePosition()
Returns the position within the adapter's data set for the last item displayed on screen.
OnItemClickListenergetOnItemClickListener()
OnItemLongClickListenergetOnItemLongClickListener()
intgetPaddingTop()
Returns the top padding of this view.
intgetPositionForView(View view)
Returns the position within the adapter's data set for the view, where view is a an adapter item or a descendant of an adapter item.
ObjectgetSelectedItem()
intgetSelectedItemPosition()
Return the position of the currently selected item within the adapter's data set
ObjectgetTag()
Returns this view's tag.
intgetTop()
Top position of this view relative to its parent.
booleanisFocused()
Returns true if this view has focus
booleanperformItemClick(View view, int position, long id)
Call the OnItemClickListener, if it is defined.
booleanpost(Runnable action)

Causes the Runnable to be added to the message queue.

booleanrequestFocusFromTouch()
Call this to try to give focus to a specific view or to one of its descendants.
voidsetAdapter(T adapter)
Sets the adapter that provides the data and the views to represent the data in this widget.
voidsetEmptyView(View emptyView)
Sets the view to show if the adapter is empty
voidsetId(@IdRes int id)
Sets the identifier for this view.
voidsetOnClickListener(OnClickListener l)
voidsetOnItemClickListener(@Nullable OnItemClickListener listener)
Register a callback to be invoked when an item in this AdapterView has been clicked.
voidsetOnItemLongClickListener(OnItemLongClickListener listener)
Register a callback to be invoked when an item in this AdapterView has been clicked and held
voidsetOnItemSelectedListener(@Nullable OnItemSelectedListener listener)
Register a callback to be invoked when an item in this AdapterView has been selected.
voidsetSelected(boolean selected)
Changes the selection state of this view.
voidsetSelection(int position)
Sets the currently selected item.
voidsetTag(final Object tag)
Sets the tag associated with this view.
voidsetTag(int key, final Object tag)
Sets a tag associated with this view and a key.
voidsetVisibility(@Visibility int visibility)
Set the visibility state of this view.
booleanshowContextMenu()
Shows the context menu for this view.