|
Build 1.0_r1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectandroid.view.View
android.view.ViewGroup
android.widget.AdapterView
public abstract class AdapterView
An AdapterView is a view whose children are determined by an Adapter.
See ListView, GridView, Spinner and Gallery for commonly used subclasses of AdapterView.
| Nested Class Summary | |
|---|---|
static class |
AdapterView.AdapterContextMenuInfo
Extra menu information provided to the onCreateContextMenu(ContextMenu, View, ContextMenuInfo) callback when a context menu is brought up for this AdapterView. |
static interface |
AdapterView.OnItemClickListener
Interface definition for a callback to be invoked when an item in this AdapterView has been clicked. |
static interface |
AdapterView.OnItemLongClickListener
Interface definition for a callback to be invoked when an item in this view has been clicked and held. |
static interface |
AdapterView.OnItemSelectedListener
Interface definition for a callback to be invoked when an item in this view has been selected. |
| Nested classes/interfaces inherited from class android.view.ViewGroup |
|---|
ViewGroup.LayoutParams, ViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListener |
| Nested classes/interfaces inherited from class android.view.View |
|---|
View.BaseSavedState, View.MeasureSpec, View.OnClickListener, View.OnCreateContextMenuListener, View.OnFocusChangeListener, View.OnKeyListener, View.OnLongClickListener, View.OnTouchListener |
| Field Summary | |
|---|---|
static int |
INVALID_POSITION
Represents an invalid position. |
static long |
INVALID_ROW_ID
Represents an empty or invalid row id Constant Value: -9223372036854775808 (0x8000000000000000) |
static int |
ITEM_VIEW_TYPE_HEADER_OR_FOOTER
The item view type returned by getItemViewType(int) when the item is a header or footer. |
static int |
ITEM_VIEW_TYPE_IGNORE
The item view type returned by getItemViewType(int) when the adapter does not want the item's view recycled. |
| Fields inherited from class android.view.ViewGroup |
|---|
CLIP_TO_PADDING_MASK, FLAG_USE_CHILD_DRAWING_ORDER, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE |
| Constructor Summary | |
|---|---|
AdapterView(Context context)
|
|
AdapterView(Context context,
AttributeSet attrs)
|
|
AdapterView(Context context,
AttributeSet attrs,
int defStyle)
|
|
| Method Summary | |
|---|---|
void |
addView(View child)
This method is not supported and throws an UnsupportedOperationException when called. |
void |
addView(View child,
int index)
This method is not supported and throws an UnsupportedOperationException when called. |
void |
addView(View child,
int index,
ViewGroup.LayoutParams params)
This method is not supported and throws an UnsupportedOperationException when called. |
void |
addView(View child,
ViewGroup.LayoutParams params)
This method is not supported and throws an UnsupportedOperationException when called. |
protected boolean |
canAnimate()
Indicates whether the view group has the ability to animate its children after the first layout. |
protected void |
dispatchRestoreInstanceState(SparseArray container)
Override to prevent thawing of any views created by the adapter. |
protected void |
dispatchSaveInstanceState(SparseArray container)
Override to prevent freezing of any views created by the adapter. |
abstract Adapter |
getAdapter()
Returns the adapter currently associated with this widget. |
int |
getCount()
|
View |
getEmptyView()
When the current adapter is empty, the AdapterView can display a special view call the empty view. |
int |
getFirstVisiblePosition()
Returns the position within the adapter's data set for the first item displayed on screen. |
Object |
getItemAtPosition(int position)
Gets the data associated with the specified position in the list. |
long |
getItemIdAtPosition(int position)
|
int |
getLastVisiblePosition()
Returns the position within the adapter's data set for the last item displayed on screen. |
AdapterView.OnItemClickListener |
getOnItemClickListener()
|
AdapterView.OnItemLongClickListener |
getOnItemLongClickListener()
|
AdapterView.OnItemSelectedListener |
getOnItemSelectedListener()
|
int |
getPositionForView(View view)
Get 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. |
Object |
getSelectedItem()
|
long |
getSelectedItemId()
|
int |
getSelectedItemPosition()
Return the position of the currently selected item within the adapter's data set |
abstract View |
getSelectedView()
|
protected void |
onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
Called from layout when this view should assign a size and position to each of its children. |
boolean |
performItemClick(View view,
int position,
long id)
Call the OnItemClickListener, if it is defined. |
void |
removeAllViews()
This method is not supported and throws an UnsupportedOperationException when called. |
void |
removeView(View child)
This method is not supported and throws an UnsupportedOperationException when called. |
void |
removeViewAt(int index)
This method is not supported and throws an UnsupportedOperationException when called. |
abstract void |
setAdapter(Adapter adapter)
Sets the adapter that provides the data and the views to represent the data in this widget. |
void |
setEmptyView(View emptyView)
Sets the view to show if the adapter is empty |
void |
setFocusable(boolean focusable)
Set whether this view can receive the focus. |
void |
setFocusableInTouchMode(boolean focusable)
Set whether this view can receive focus while in touch mode. |
void |
setOnClickListener(View.OnClickListener l)
Register a callback to be invoked when this view is clicked. |
void |
setOnItemClickListener(AdapterView.OnItemClickListener listener)
Register a callback to be invoked when an item in this AdapterView has been clicked. |
void |
setOnItemLongClickListener(AdapterView.OnItemLongClickListener listener)
Register a callback to be invoked when an item in this AdapterView has been clicked and held |
void |
setOnItemSelectedListener(AdapterView.OnItemSelectedListener listener)
Register a callback to be invoked when an item in this AdapterView has been selected. |
abstract void |
setSelection(int i)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface android.view.ViewParent |
|---|
createContextMenu, getParent, isLayoutRequested, requestLayout |
| Field Detail |
|---|
public static final int ITEM_VIEW_TYPE_IGNORE
public static final int ITEM_VIEW_TYPE_HEADER_OR_FOOTER
public static final int INVALID_POSITION
public static final long INVALID_ROW_ID
| Constructor Detail |
|---|
public AdapterView(Context context)
public AdapterView(Context context,
AttributeSet attrs)
public AdapterView(Context context,
AttributeSet attrs,
int defStyle)
| Method Detail |
|---|
public void setOnItemClickListener(AdapterView.OnItemClickListener listener)
listener - The callback that will be invoked.public final AdapterView.OnItemClickListener getOnItemClickListener()
public boolean performItemClick(View view,
int position,
long id)
view - The view within the AdapterView that was clicked.position - The position of the view in the adapter.id - The row id of the item that was clicked.
public void setOnItemLongClickListener(AdapterView.OnItemLongClickListener listener)
listener - The callback that will runpublic final AdapterView.OnItemLongClickListener getOnItemLongClickListener()
public void setOnItemSelectedListener(AdapterView.OnItemSelectedListener listener)
listener - The callback that will runpublic final AdapterView.OnItemSelectedListener getOnItemSelectedListener()
public abstract Adapter getAdapter()
public abstract void setAdapter(Adapter adapter)
adapter - The adapter to use to create this view's content.public void addView(View child)
addView in class ViewGroupchild - Ignored.
UnsupportedOperationException - Every time this method is invoked.generateDefaultLayoutParams()
public void addView(View child,
int index)
addView in class ViewGroupchild - Ignored.index - Ignored.
UnsupportedOperationException - Every time this method is invoked.generateDefaultLayoutParams()
public void addView(View child,
ViewGroup.LayoutParams params)
addView in interface ViewManageraddView in class ViewGroupchild - Ignored.params - Ignored.
UnsupportedOperationException - Every time this method is invoked.
public void addView(View child,
int index,
ViewGroup.LayoutParams params)
addView in class ViewGroupchild - Ignored.index - Ignored.params - Ignored.
UnsupportedOperationException - Every time this method is invoked.public void removeView(View child)
removeView in interface ViewManagerremoveView in class ViewGroupchild - Ignored.
UnsupportedOperationException - Every time this method is invoked.public void removeViewAt(int index)
removeViewAt in class ViewGroupindex - Ignored.
UnsupportedOperationException - Every time this method is invoked.public void removeAllViews()
removeAllViews in class ViewGroupUnsupportedOperationException - Every time this method is invoked.
protected void onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
onLayout in class ViewGroupchanged - This is a new size or position for this viewleft - Left position, relative to parenttop - Top position, relative to parentright - Right position, relative to parentbottom - Bottom position, relative to parentpublic int getSelectedItemPosition()
public long getSelectedItemId()
public abstract View getSelectedView()
public Object getSelectedItem()
public int getCount()
public int getPositionForView(View view)
view - an adapter item, or a descendant of an adapter item. This must be visible in this
AdapterView at the time of the call.
public int getFirstVisiblePosition()
public int getLastVisiblePosition()
public abstract void setSelection(int i)
public void setEmptyView(View emptyView)
public View getEmptyView()
public void setFocusable(boolean focusable)
setFocusable in class Viewfocusable - If true, this view can receive the focus.setFocusableInTouchMode(boolean)public void setFocusableInTouchMode(boolean focusable)
setFocusableInTouchMode in class Viewfocusable - If true, this view can receive the focus while
in touch mode.setFocusable(boolean)public Object getItemAtPosition(int position)
position - Which data to get
public long getItemIdAtPosition(int position)
public void setOnClickListener(View.OnClickListener l)
setOnClickListener in class Viewl - The callback that will runsetClickable(boolean)protected void dispatchSaveInstanceState(SparseArray container)
dispatchSaveInstanceState in class ViewGroupcontainer - The SparseArray in which to save the view's state.dispatchRestoreInstanceState(SparseArray) ,
saveHierarchyState(SparseArray) ,
onSaveInstanceState()protected void dispatchRestoreInstanceState(SparseArray container)
dispatchRestoreInstanceState in class ViewGroupcontainer - The SparseArray which holds previously saved state.dispatchSaveInstanceState(SparseArray) ,
restoreHierarchyState(SparseArray) ,
onRestoreInstanceState(Parcelable)protected boolean canAnimate()
canAnimate in class ViewGroup
|
Build 1.0_r1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||