Type - The type of the adapter's underlying datapublic class ArrayAdapter<Type>
extends android.widget.ArrayAdapter<Type>
ArrayAdapter in order to be
able to customize the text and control color of the adapter's items.| Constructor and Description |
|---|
ArrayAdapter(android.content.Context context,
int resourceId)
Creates a new array adapter.
|
ArrayAdapter(android.content.Context context,
int resourceId,
int textViewResourceId)
Creates a new array adapter.
|
ArrayAdapter(android.content.Context context,
int resourceId,
int textViewResourceId,
java.util.List<Type> items)
Creates a new array adapter.
|
ArrayAdapter(android.content.Context context,
int resourceId,
int textViewResourceId,
Type[] items)
Creates a new array adapter.
|
ArrayAdapter(android.content.Context context,
int resourceId,
java.util.List<Type> items)
Creates a new array adapter.
|
ArrayAdapter(android.content.Context context,
int resourceId,
Type[] items)
Creates a new array adapter.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getItemColor()
Returns the text color of the adapter's items.
|
android.view.View |
getView(int position,
android.view.View convertView,
android.view.ViewGroup parent) |
void |
setItemColor(int color)
Sets the text color of the adapter's items.
|
add, addAll, addAll, clear, createFromResource, getContext, getCount, getDropDownView, getDropDownViewTheme, getFilter, getItem, getItemId, getPosition, insert, notifyDataSetChanged, remove, setDropDownViewResource, setDropDownViewTheme, setNotifyOnChange, sortareAllItemsEnabled, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetInvalidated, registerDataSetObserver, unregisterDataSetObserverpublic ArrayAdapter(android.content.Context context,
int resourceId)
context - The context, which should be used by the adapter, as an instance of the class Context. The context may not be nullresourceId - The resource id of the layout, which should be used by the adapter, as an Integer value. The resource id must correspond to a valid layout resourcepublic ArrayAdapter(android.content.Context context,
int resourceId,
int textViewResourceId)
context - The context, which should be used by the adapter, as an instance of the class Context. The context may not be nullresourceId - The resource id of the layout, which should be used by the adapter, as an Integer value. The resource id must correspond to a valid layout resourcetextViewResourceId - The id of the text view within the layout resource to be populated, as an Integer valuepublic ArrayAdapter(android.content.Context context,
int resourceId,
Type[] items)
context - The context, which should be used by the adapter, as an instance of the class Context. The context may not be nullresourceId - The resource id of the layout, which should be used by the adapter, as an Integer value. The resource id must correspond to a valid layout resourceitems - The items of the adapter as an array of the generic type Type. The items may not be
nullpublic ArrayAdapter(android.content.Context context,
int resourceId,
int textViewResourceId,
Type[] items)
context - The context, which should be used by the adapter, as an instance of the class Context. The context may not be nullresourceId - The resource id of the layout, which should be used by the adapter, as an Integer value. The resource id must correspond to a valid layout resourcetextViewResourceId - The id of the text view within the layout resource to be populated, as an Integer valueitems - The items of the adapter as an array of the generic type Type. The items may not be
nullpublic ArrayAdapter(android.content.Context context,
int resourceId,
java.util.List<Type> items)
context - The context, which should be used by the adapter, as an instance of the class Context. The context may not be nullresourceId - The resource id of the layout, which should be used by the adapter, as an Integer value. The resource id must correspond to a valid layout resourceitems - A list, which contains the items of the adapter, as an instance of the type List. The list may not be nullpublic ArrayAdapter(android.content.Context context,
int resourceId,
int textViewResourceId,
java.util.List<Type> items)
context - The context, which should be used by the adapter, as an instance of the class Context. The context may not be nullresourceId - The resource id of the layout, which should be used by the adapter, as an Integer value. The resource id must correspond to a valid layout resourcetextViewResourceId - The id of the text view within the layout resource to be populated, as an Integer valueitems - A list, which contains the items of the adapter, as an instance of the type List. The list may not be nullpublic final int getItemColor()
Integer value or -1, if no custom
color has been setpublic final void setItemColor(int color)
color - The text color, which should be set, as an Integer value or -1, if no custom
color should be setpublic final android.view.View getView(int position,
android.view.View convertView,
android.view.ViewGroup parent)
getView in interface android.widget.AdaptergetView in class android.widget.ArrayAdapter<Type>