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

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

Introduction

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

The text is from its open source code.

Subclass

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

Constructor

Method

voidadd(@Nullable T object)
Adds the specified object at the end of the array.
voidaddAll(@NonNull Collection collection)
Adds the specified Collection at the end of the array.
voidaddAll(T... items)
Adds the specified items at the end of the array.
voidclear()
Remove all elements from the list.
ArrayAdaptercreateFromResource(@NonNull Context context, @ArrayRes int textArrayResId, @LayoutRes int textViewResId)
Creates a new ArrayAdapter from external resources.
intgetCount()
FiltergetFilter()
TgetItem(int position)
intgetPosition(@Nullable T item)
Returns the position of the specified item in the array.
ViewgetView(int position, @Nullable View convertView, @NonNull ViewGroup parent)
voidinsert(@Nullable T object, int index)
Inserts the specified object at the specified index in the array.
voidnotifyDataSetChanged()
voidremove(@Nullable T object)
Removes the specified object from the array.
voidsetDropDownViewResource(@LayoutRes int resource)

Sets the layout resource to create the drop down views.

voidsetNotifyOnChange(boolean notifyOnChange)
Control whether methods that change the list ( #add , #addAll(Collection) , #addAll(Object[]) , #insert , #remove , #clear , #sort(Comparator) ) automatically call #notifyDataSetChanged .
voidsort(@NonNull Comparator comparator)
Sorts the content of this adapter using the specified comparator.