class InstalledAppsList
extends android.widget.ArrayAdapter<java.lang.String>
Modifier and Type | Field and Description |
---|---|
private android.graphics.drawable.Drawable[] |
appIcon
List of app icons
|
private java.lang.String[] |
appName
List of app names
|
private android.app.Activity |
context
Application context
|
Constructor and Description |
---|
InstalledAppsList(android.app.Activity context,
java.lang.String[] appName,
android.graphics.drawable.Drawable[] appIcon)
Array adapter for app list view
|
Modifier and Type | Method and Description |
---|---|
android.view.View |
getView(int position,
android.view.View view,
android.view.ViewGroup parent)
Get a View that displays the data at the specified position in the data set.
|
add, addAll, addAll, clear, createFromResource, getContext, getCount, getDropDownView, getFilter, getItem, getItemId, getPosition, insert, notifyDataSetChanged, remove, setDropDownViewResource, setNotifyOnChange, sort
private final android.graphics.drawable.Drawable[] appIcon
private final java.lang.String[] appName
private final android.app.Activity context
public InstalledAppsList(android.app.Activity context, java.lang.String[] appName, android.graphics.drawable.Drawable[] appIcon)
context
- application contextappName
- list of app namesappIcon
- list of app iconspublic android.view.View getView(int position, android.view.View view, android.view.ViewGroup parent)
android.widget.ArrayAdapter
LayoutInflater.inflate(int, android.view.ViewGroup, boolean)
to specify a root view and to prevent attachment to the root.getView
in interface android.widget.Adapter
getView
in class android.widget.ArrayAdapter<java.lang.String>
position
- The position of the item within the adapter's data set of the item whose view
we want.view
- The old view to reuse, if possible. Note: You should check that this view
is non-null and of an appropriate type before using. If it is not possible to convert
this view to display the correct data, this method can create a new view.
Heterogeneous lists can specify their number of view types, so that this View is
always of the right type (see Adapter.getViewTypeCount()
and
Adapter.getItemViewType(int)
).parent
- The parent that this view will eventually be attached to