android.widget
public
abstract
class
android.widget.CursorTreeAdapter
Summary
Fields
Public Constructors
Public Methods
| |
|
|
|
Object |
getChild(int groupPosition, int childPosition) |
| |
|
|
|
long |
getChildId(int groupPosition, int childPosition) |
| |
|
|
|
View |
getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) |
| |
|
|
|
int |
getChildrenCount(int groupPosition) |
| |
|
|
|
Object |
getGroup(int groupPosition) |
| |
|
|
|
int |
getGroupCount() |
| |
|
|
|
long |
getGroupId(int groupPosition) |
| |
|
|
|
View |
getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) |
| |
|
|
|
boolean |
isChildSelectable(int groupPosition, int childPosition) |
| |
|
|
|
void |
notifyDataSetChanged() |
| |
|
|
|
void |
notifyDataSetInvalidated() |
| |
|
|
|
void |
onGroupCollapsed(int groupPosition) |
| |
|
|
|
boolean |
stableIds() |
Protected Methods
| abstract |
|
|
|
void |
bindChildView(View view, Context context, Cursor cursor, boolean isLastChild) |
| abstract |
|
|
|
void |
bindGroupView(View view, Context context, Cursor cursor, boolean isExpanded) |
| |
synchronized |
|
|
void |
deactivateChildrenCursorHelper(int groupPosition) |
| abstract |
|
|
|
Cursor |
getChildrenCursor(Cursor groupCursor) |
| |
synchronized |
|
|
MyCursorHelper |
getChildrenCursorHelper(int groupPosition) |
| abstract |
|
|
|
View |
newChildView(Context context, Cursor cursor, boolean isLastChild, ViewGroup parent) |
| abstract |
|
|
|
View |
newGroupView(Context context, Cursor cursor, boolean isExpanded, ViewGroup parent) |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Fields
protected
MyCursorHelper
mGroupCursorHelper
The cursor helper that is used to get the groups
Public Constructors
public
CursorTreeAdapter(Cursor cursor, Context context)
Constructor. The adapter will call requery() on the cursor whenever
it changes so that the most recent data is always displayed.
Parameters
| cursor
| The cursor from which to get the data for the groups.
|
public
CursorTreeAdapter(Cursor cursor, Context context, boolean autoRequery)
Constructor
Parameters
| cursor
| The cursor from which to get the data for the groups. |
| context
| The context |
| autoRequery
| If true the adapter will call requery() on the
cursor whenever it changes so the most recent
data is always displayed.
|
Public Methods
public
Object
getChild(int groupPosition, int childPosition)
public
long
getChildId(int groupPosition, int childPosition)
public
View
getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent)
public
int
getChildrenCount(int groupPosition)
public
Object
getGroup(int groupPosition)
public
int
getGroupCount()
public
long
getGroupId(int groupPosition)
public
View
getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent)
public
boolean
isChildSelectable(int groupPosition, int childPosition)
public
void
notifyDataSetChanged()
public
void
notifyDataSetInvalidated()
public
void
onGroupCollapsed(int groupPosition)
Called when a group is being collapsed.
public
boolean
stableIds()
Protected Methods
protected
abstract
void
bindChildView(View view, Context context, Cursor cursor, boolean isLastChild)
Bind an existing view to the child data pointed to by cursor
Parameters
| view
| Existing view, returned earlier by newChildView |
| context
| Interface to application's global information |
| cursor
| The cursor from which to get the data. The cursor is
already moved to the correct position. |
| isLastChild
| Whether the child is the last child within its group.
|
protected
abstract
void
bindGroupView(View view, Context context, Cursor cursor, boolean isExpanded)
Bind an existing view to the group data pointed to by cursor.
Parameters
| view
| Existing view, returned earlier by newGroupView. |
| context
| Interface to application's global information |
| cursor
| The cursor from which to get the data. The cursor is
already moved to the correct position. |
| isExpanded
| Whether the group is expanded.
|
protected
synchronized
void
deactivateChildrenCursorHelper(int groupPosition)
Deactivates the Cursor and removes the helper from cache.
Parameters
| groupPosition
| The group whose children Cursor and helper should be
deactivated.
|
protected
abstract
Cursor
getChildrenCursor(Cursor groupCursor)
Gets the Cursor for the children at the given group. Subclasses must
implement this method to return the children data for a particular group.
It is your responsibility to manage this Cursor through the Activity
lifecycle. It is a good idea to use managedQuery(Uri, String[], String, String[], String) which
will handle this for you. In some situations, the adapter will deactivate
the Cursor on its own, but this will not always be the case, so please
ensure the Cursor is properly managed.
Parameters
| groupCursor
| The cursor pointing to the group whose children cursor
should be returned |
Returns
- The cursor for the children of a particular group
protected
synchronized
MyCursorHelper
getChildrenCursorHelper(int groupPosition)
Gets the cursor helper for the children in the given group.
Parameters
| groupPosition
| The group whose children will be returned |
Returns
- The cursor helper for the children of the given group
protected
abstract
View
newChildView(Context context, Cursor cursor, boolean isLastChild, ViewGroup parent)
Makes a new child view to hold the data pointed to by cursor.
Parameters
| context
| Interface to application's global information |
| cursor
| The cursor from which to get the data. The cursor is
already moved to the correct position. |
| isLastChild
| Whether the child is the last child within its group. |
| parent
| The parent to which the new view is attached to |
protected
abstract
View
newGroupView(Context context, Cursor cursor, boolean isExpanded, ViewGroup parent)
Makes a new group view to hold the group data pointed to by cursor.
Parameters
| context
| Interface to application's global information |
| cursor
| The group cursor from which to get the data. The cursor is
already moved to the correct position. |
| isExpanded
| Whether the group is expanded. |
| parent
| The parent to which the new view is attached to |