Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#nestedclasses) \| [Ctors](https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#pubctors) \| [Methods](https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#pubmethods) \| [Protected Methods](https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#promethods) \| [Inherited Methods](https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#inhmethods)

# SimpleCursorTreeAdapter

*** ** * ** ***

` public abstract class SimpleCursorTreeAdapter `   
` ` ` ` ` ` ` extends https://developer.android.com/reference/android/widget/ResourceCursorTreeAdapter ` ` `

|---|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||||
| ↳ | [android.widget.BaseExpandableListAdapter](https://developer.android.com/reference/android/widget/BaseExpandableListAdapter) ||||
|   | ↳ | [android.widget.CursorTreeAdapter](https://developer.android.com/reference/android/widget/CursorTreeAdapter) |||
|   |   | ↳ | [android.widget.ResourceCursorTreeAdapter](https://developer.android.com/reference/android/widget/ResourceCursorTreeAdapter) ||
|   |   |   | ↳ | android.widget.SimpleCursorTreeAdapter |

<br />

*** ** * ** ***

An easy adapter to map columns from a cursor to TextViews or ImageViews defined in an XML file. You can specify which columns you want, which views you want to display the columns, and the XML file that defines the appearance of these views. Separate XML files for child and groups are possible. Binding occurs in two phases. First, if a `https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter.ViewBinder` is available, `https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter.ViewBinder#setViewValue(android.view.View,%20android.database.Cursor,%20int)` is invoked. If the returned value is true, binding has occurred. If the returned value is false and the view to bind is a TextView, `https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#setViewText(android.widget.TextView,%20java.lang.String)` is invoked. If the returned value is false and the view to bind is an ImageView, `https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#setViewImage(android.widget.ImageView,%20java.lang.String)` is invoked. If no appropriate binding can be found, an `https://developer.android.com/reference/java/lang/IllegalStateException` is thrown.

## Summary

| ### Nested classes ||
|---|---|
| ` interface` | `https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter.ViewBinder` This class can be used by external clients of SimpleCursorTreeAdapter to bind values from the Cursor to views. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#SimpleCursorTreeAdapter(android.content.Context,%20android.database.Cursor,%20int,%20int,%20java.lang.String[],%20int[],%20int,%20int,%20java.lang.String[],%20int[])(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/database/Cursor cursor, int collapsedGroupLayout, int expandedGroupLayout, https://developer.android.com/reference/java/lang/String groupFrom, int[] groupTo, int childLayout, int lastChildLayout, https://developer.android.com/reference/java/lang/String childFrom, int[] childTo) ` Constructor. |
| ` https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#SimpleCursorTreeAdapter(android.content.Context,%20android.database.Cursor,%20int,%20int,%20java.lang.String[],%20int[],%20int,%20java.lang.String[],%20int[])(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/database/Cursor cursor, int collapsedGroupLayout, int expandedGroupLayout, https://developer.android.com/reference/java/lang/String groupFrom, int[] groupTo, int childLayout, https://developer.android.com/reference/java/lang/String childFrom, int[] childTo) ` Constructor. |
| ` https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#SimpleCursorTreeAdapter(android.content.Context,%20android.database.Cursor,%20int,%20java.lang.String[],%20int[],%20int,%20java.lang.String[],%20int[])(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/database/Cursor cursor, int groupLayout, https://developer.android.com/reference/java/lang/String groupFrom, int[] groupTo, int childLayout, https://developer.android.com/reference/java/lang/String childFrom, int[] childTo) ` Constructor. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter.ViewBinder` | ` https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#getViewBinder()() ` Returns the `https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter.ViewBinder` used to bind data to views. |
| ` void` | ` https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#setViewBinder(android.widget.SimpleCursorTreeAdapter.ViewBinder)(https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter.ViewBinder viewBinder) ` Sets the binder used to bind data to views. |
| ` void` | ` https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#setViewText(android.widget.TextView,%20java.lang.String)(https://developer.android.com/reference/android/widget/TextView v, https://developer.android.com/reference/java/lang/String text) ` Called by bindView() to set the text for a TextView but only if there is no existing ViewBinder or if the existing ViewBinder cannot handle binding to a TextView. |

| ### Protected methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#bindChildView(android.view.View,%20android.content.Context,%20android.database.Cursor,%20boolean)(https://developer.android.com/reference/android/view/View view, https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/database/Cursor cursor, boolean isLastChild) ` Bind an existing view to the child data pointed to by cursor |
| ` void` | ` https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#bindGroupView(android.view.View,%20android.content.Context,%20android.database.Cursor,%20boolean)(https://developer.android.com/reference/android/view/View view, https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/database/Cursor cursor, boolean isExpanded) ` Bind an existing view to the group data pointed to by cursor. |
| ` void` | ` https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#setViewImage(android.widget.ImageView,%20java.lang.String)(https://developer.android.com/reference/android/widget/ImageView v, https://developer.android.com/reference/java/lang/String value) ` Called by bindView() to set the image for an ImageView. |

### Inherited methods

From class ` https://developer.android.com/reference/android/widget/ResourceCursorTreeAdapter ` ` https://developer.android.com/reference/android/view/View` ` https://developer.android.com/reference/android/widget/ResourceCursorTreeAdapter#newChildView(android.content.Context,%20android.database.Cursor,%20boolean,%20android.view.ViewGroup)(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/database/Cursor cursor, boolean isLastChild, https://developer.android.com/reference/android/view/ViewGroup parent) `

Makes a new child view to hold the data pointed to by cursor.
` https://developer.android.com/reference/android/view/View` ` https://developer.android.com/reference/android/widget/ResourceCursorTreeAdapter#newGroupView(android.content.Context,%20android.database.Cursor,%20boolean,%20android.view.ViewGroup)(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/database/Cursor cursor, boolean isExpanded, https://developer.android.com/reference/android/view/ViewGroup parent) `

Makes a new group view to hold the group data pointed to by cursor.
From class ` https://developer.android.com/reference/android/widget/CursorTreeAdapter ` ` abstract void` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#bindChildView(android.view.View,%20android.content.Context,%20android.database.Cursor,%20boolean)(https://developer.android.com/reference/android/view/View view, https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/database/Cursor cursor, boolean isLastChild) `

Bind an existing view to the child data pointed to by cursor
` abstract void` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#bindGroupView(android.view.View,%20android.content.Context,%20android.database.Cursor,%20boolean)(https://developer.android.com/reference/android/view/View view, https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/database/Cursor cursor, boolean isExpanded) `

Bind an existing view to the group data pointed to by cursor.
` void` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#changeCursor(android.database.Cursor)(https://developer.android.com/reference/android/database/Cursor cursor) ` ` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#convertToString(android.database.Cursor)(https://developer.android.com/reference/android/database/Cursor cursor) ` ` https://developer.android.com/reference/android/database/Cursor` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#getChild(int,%20int)(int groupPosition, int childPosition) `

<br />

` long` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#getChildId(int,%20int)(int groupPosition, int childPosition) `

<br />

` https://developer.android.com/reference/android/view/View` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#getChildView(int,%20int,%20boolean,%20android.view.View,%20android.view.ViewGroup)(int groupPosition, int childPosition, boolean isLastChild, https://developer.android.com/reference/android/view/View convertView, https://developer.android.com/reference/android/view/ViewGroup parent) `

<br />

` int` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#getChildrenCount(int)(int groupPosition) `

<br />

` abstract https://developer.android.com/reference/android/database/Cursor` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#getChildrenCursor(android.database.Cursor)(https://developer.android.com/reference/android/database/Cursor groupCursor) `

Gets the Cursor for the children at the given group.
` https://developer.android.com/reference/android/database/Cursor` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#getCursor()() ` ` https://developer.android.com/reference/android/widget/Filter` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#getFilter()() `

<br />

Returns a filter that can be used to constrain data with a filtering pattern.
` https://developer.android.com/reference/android/widget/FilterQueryProvider` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#getFilterQueryProvider()() ` ` https://developer.android.com/reference/android/database/Cursor` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#getGroup(int)(int groupPosition) `

<br />

` int` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#getGroupCount()() `

<br />

` long` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#getGroupId(int)(int groupPosition) `

<br />

` https://developer.android.com/reference/android/view/View` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#getGroupView(int,%20boolean,%20android.view.View,%20android.view.ViewGroup)(int groupPosition, boolean isExpanded, https://developer.android.com/reference/android/view/View convertView, https://developer.android.com/reference/android/view/ViewGroup parent) `

<br />

` boolean` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#hasStableIds()() `

<br />

` boolean` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#isChildSelectable(int,%20int)(int groupPosition, int childPosition) `

<br />

` abstract https://developer.android.com/reference/android/view/View` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#newChildView(android.content.Context,%20android.database.Cursor,%20boolean,%20android.view.ViewGroup)(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/database/Cursor cursor, boolean isLastChild, https://developer.android.com/reference/android/view/ViewGroup parent) `

Makes a new child view to hold the data pointed to by cursor.
` abstract https://developer.android.com/reference/android/view/View` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#newGroupView(android.content.Context,%20android.database.Cursor,%20boolean,%20android.view.ViewGroup)(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/database/Cursor cursor, boolean isExpanded, https://developer.android.com/reference/android/view/ViewGroup parent) `

Makes a new group view to hold the group data pointed to by cursor.
` void` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#notifyDataSetChanged()() `

<br />

` void` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#notifyDataSetChanged(boolean)(boolean releaseCursors) `

Notifies a data set change, but with the option of not releasing any cached cursors.
` void` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#notifyDataSetInvalidated()() `

<br />

` void` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#onGroupCollapsed(int)(int groupPosition) `

Called when a group is collapsed.
` https://developer.android.com/reference/android/database/Cursor` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#runQueryOnBackgroundThread(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence constraint) ` ` void` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#setChildrenCursor(int,%20android.database.Cursor)(int groupPosition, https://developer.android.com/reference/android/database/Cursor childrenCursor) `

Sets the children Cursor for a particular group.
` void` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#setFilterQueryProvider(android.widget.FilterQueryProvider)(https://developer.android.com/reference/android/widget/FilterQueryProvider filterQueryProvider) ` ` void` ` https://developer.android.com/reference/android/widget/CursorTreeAdapter#setGroupCursor(android.database.Cursor)(https://developer.android.com/reference/android/database/Cursor cursor) `

Sets the group Cursor.
From class ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter ` ` boolean` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#areAllItemsEnabled()() `

<br />

` int` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#getChildType(int,%20int)(int groupPosition, int childPosition) `

Get the type of child View that will be created by `https://developer.android.com/reference/android/widget/ExpandableListAdapter#getChildView(int,%20int,%20boolean,%20android.view.View,%20android.view.ViewGroup)` for the specified child item.
` int` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#getChildTypeCount()() `

<br />

Returns the number of types of child Views that will be created by `https://developer.android.com/reference/android/widget/ExpandableListAdapter#getChildView(int,%20int,%20boolean,%20android.view.View,%20android.view.ViewGroup)` .
` long` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#getCombinedChildId(long,%20long)(long groupId, long childId) `

Override this method if you foresee a clash in IDs based on this scheme:

Base implementation returns a long:
- bit 0: Whether this ID points to a child (unset) or group (set), so for this method this bit will be 1. <br />

` long` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#getCombinedGroupId(long)(long groupId) `

Override this method if you foresee a clash in IDs based on this scheme:

Base implementation returns a long:
- bit 0: Whether this ID points to a child (unset) or group (set), so for this method this bit will be 0. <br />

` int` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#getGroupType(int)(int groupPosition) `

Get the type of group View that will be created by `https://developer.android.com/reference/android/widget/ExpandableListAdapter#getGroupView(int,%20boolean,%20android.view.View,%20android.view.ViewGroup)` .
` int` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#getGroupTypeCount()() `

<br />

Returns the number of types of group Views that will be created by `https://developer.android.com/reference/android/widget/ExpandableListAdapter#getGroupView(int,%20boolean,%20android.view.View,%20android.view.ViewGroup)` .
` boolean` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#isEmpty()() `

<br />

` void` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#notifyDataSetChanged()() ` ` void` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#notifyDataSetInvalidated()() ` ` void` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#onGroupCollapsed(int)(int groupPosition) `

Called when a group is collapsed.
` void` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#onGroupExpanded(int)(int groupPosition) `

Called when a group is expanded.
` void` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#registerDataSetObserver(android.database.DataSetObserver)(https://developer.android.com/reference/android/database/DataSetObserver observer) `

<br />

` void` ` https://developer.android.com/reference/android/widget/BaseExpandableListAdapter#unregisterDataSetObserver(android.database.DataSetObserver)(https://developer.android.com/reference/android/database/DataSetObserver observer) `

<br />

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/widget/Filterable ` ` abstract https://developer.android.com/reference/android/widget/Filter` ` https://developer.android.com/reference/android/widget/Filterable#getFilter()() `

<br />

Returns a filter that can be used to constrain data with a filtering pattern.
From interface ` https://developer.android.com/reference/android/widget/ExpandableListAdapter ` ` abstract boolean` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#areAllItemsEnabled()() ` ` abstract https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#getChild(int,%20int)(int groupPosition, int childPosition) `

Gets the data associated with the given child within the given group.
` abstract long` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#getChildId(int,%20int)(int groupPosition, int childPosition) `

Gets the ID for the given child within the given group.
` abstract https://developer.android.com/reference/android/view/View` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#getChildView(int,%20int,%20boolean,%20android.view.View,%20android.view.ViewGroup)(int groupPosition, int childPosition, boolean isLastChild, https://developer.android.com/reference/android/view/View convertView, https://developer.android.com/reference/android/view/ViewGroup parent) `

Gets a View that displays the data for the given child within the given group.
` abstract int` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#getChildrenCount(int)(int groupPosition) `

Gets the number of children in a specified group.
` abstract long` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#getCombinedChildId(long,%20long)(long groupId, long childId) `

Gets an ID for a child that is unique across any item (either group or child) that is in this list.
` abstract long` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#getCombinedGroupId(long)(long groupId) `

Gets an ID for a group that is unique across any item (either group or child) that is in this list.
` abstract https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#getGroup(int)(int groupPosition) `

Gets the data associated with the given group.
` abstract int` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#getGroupCount()() `

Gets the number of groups.
` abstract long` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#getGroupId(int)(int groupPosition) `

Gets the ID for the group at the given position.
` abstract https://developer.android.com/reference/android/view/View` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#getGroupView(int,%20boolean,%20android.view.View,%20android.view.ViewGroup)(int groupPosition, boolean isExpanded, https://developer.android.com/reference/android/view/View convertView, https://developer.android.com/reference/android/view/ViewGroup parent) `

Gets a View that displays the given group.
` abstract boolean` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#hasStableIds()() `

Indicates whether the child and group IDs are stable across changes to the underlying data.
` abstract boolean` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#isChildSelectable(int,%20int)(int groupPosition, int childPosition) `

Whether the child at the specified position is selectable.
` abstract boolean` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#isEmpty()() ` ` abstract void` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#onGroupCollapsed(int)(int groupPosition) `

Called when a group is collapsed.
` abstract void` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#onGroupExpanded(int)(int groupPosition) `

Called when a group is expanded.
` abstract void` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#registerDataSetObserver(android.database.DataSetObserver)(https://developer.android.com/reference/android/database/DataSetObserver observer) ` ` abstract void` ` https://developer.android.com/reference/android/widget/ExpandableListAdapter#unregisterDataSetObserver(android.database.DataSetObserver)(https://developer.android.com/reference/android/database/DataSetObserver observer) ` From interface ` https://developer.android.com/reference/android/widget/HeterogeneousExpandableList ` ` abstract int` ` https://developer.android.com/reference/android/widget/HeterogeneousExpandableList#getChildType(int,%20int)(int groupPosition, int childPosition) `

Get the type of child View that will be created by `https://developer.android.com/reference/android/widget/ExpandableListAdapter#getChildView(int,%20int,%20boolean,%20android.view.View,%20android.view.ViewGroup)` for the specified child item.
` abstract int` ` https://developer.android.com/reference/android/widget/HeterogeneousExpandableList#getChildTypeCount()() `

<br />

Returns the number of types of child Views that will be created by `https://developer.android.com/reference/android/widget/ExpandableListAdapter#getChildView(int,%20int,%20boolean,%20android.view.View,%20android.view.ViewGroup)` .
` abstract int` ` https://developer.android.com/reference/android/widget/HeterogeneousExpandableList#getGroupType(int)(int groupPosition) `

Get the type of group View that will be created by `https://developer.android.com/reference/android/widget/ExpandableListAdapter#getGroupView(int,%20boolean,%20android.view.View,%20android.view.ViewGroup)` .
` abstract int` ` https://developer.android.com/reference/android/widget/HeterogeneousExpandableList#getGroupTypeCount()() `

<br />

Returns the number of types of group Views that will be created by `https://developer.android.com/reference/android/widget/ExpandableListAdapter#getGroupView(int,%20boolean,%20android.view.View,%20android.view.ViewGroup)` .

## Public constructors

### SimpleCursorTreeAdapter

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SimpleCursorTreeAdapter (Context context, 
                Cursor cursor, 
                int collapsedGroupLayout, 
                int expandedGroupLayout, 
                String[] groupFrom, 
                int[] groupTo, 
                int childLayout, 
                int lastChildLayout, 
                String[] childFrom, 
                int[] childTo)
```

Constructor.

<br />

| Parameters ||
|---|---|
| `context` | `Context`: The context where the `https://developer.android.com/reference/android/widget/ExpandableListView` associated with this `https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter` is running <br /> |
| `cursor` | `Cursor`: The database cursor <br /> |
| `collapsedGroupLayout` | `int`: The resource identifier of a layout file that defines the views for a collapsed group. The layout file should include at least those named views defined in groupTo. <br /> |
| `expandedGroupLayout` | `int`: The resource identifier of a layout file that defines the views for an expanded group. The layout file should include at least those named views defined in groupTo. <br /> |
| `groupFrom` | `String`: A list of column names that will be used to display the data for a group. <br /> |
| `groupTo` | `int`: The group views (from the group layouts) that should display column in the "from" parameter. These should all be TextViews or ImageViews. The first N views in this list are given the values of the first N columns in the from parameter. <br /> |
| `childLayout` | `int`: The resource identifier of a layout file that defines the views for a child (except the last). The layout file should include at least those named views defined in childTo. <br /> |
| `lastChildLayout` | `int`: The resource identifier of a layout file that defines the views for the last child within a group. The layout file should include at least those named views defined in childTo. <br /> |
| `childFrom` | `String`: A list of column names that will be used to display the data for a child. <br /> |
| `childTo` | `int`: The child views (from the child layouts) that should display column in the "from" parameter. These should all be TextViews or ImageViews. The first N views in this list are given the values of the first N columns in the from parameter. <br /> |

### SimpleCursorTreeAdapter

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SimpleCursorTreeAdapter (Context context, 
                Cursor cursor, 
                int collapsedGroupLayout, 
                int expandedGroupLayout, 
                String[] groupFrom, 
                int[] groupTo, 
                int childLayout, 
                String[] childFrom, 
                int[] childTo)
```

Constructor.

<br />

| Parameters ||
|---|---|
| `context` | `Context`: The context where the `https://developer.android.com/reference/android/widget/ExpandableListView` associated with this `https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter` is running <br /> |
| `cursor` | `Cursor`: The database cursor <br /> |
| `collapsedGroupLayout` | `int`: The resource identifier of a layout file that defines the views for a collapsed group. The layout file should include at least those named views defined in groupTo. <br /> |
| `expandedGroupLayout` | `int`: The resource identifier of a layout file that defines the views for an expanded group. The layout file should include at least those named views defined in groupTo. <br /> |
| `groupFrom` | `String`: A list of column names that will be used to display the data for a group. <br /> |
| `groupTo` | `int`: The group views (from the group layouts) that should display column in the "from" parameter. These should all be TextViews or ImageViews. The first N views in this list are given the values of the first N columns in the from parameter. <br /> |
| `childLayout` | `int`: The resource identifier of a layout file that defines the views for a child. The layout file should include at least those named views defined in childTo. <br /> |
| `childFrom` | `String`: A list of column names that will be used to display the data for a child. <br /> |
| `childTo` | `int`: The child views (from the child layouts) that should display column in the "from" parameter. These should all be TextViews or ImageViews. The first N views in this list are given the values of the first N columns in the from parameter. <br /> |

### SimpleCursorTreeAdapter

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SimpleCursorTreeAdapter (Context context, 
                Cursor cursor, 
                int groupLayout, 
                String[] groupFrom, 
                int[] groupTo, 
                int childLayout, 
                String[] childFrom, 
                int[] childTo)
```

Constructor.

<br />

| Parameters ||
|---|---|
| `context` | `Context`: The context where the `https://developer.android.com/reference/android/widget/ExpandableListView` associated with this `https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter` is running <br /> |
| `cursor` | `Cursor`: The database cursor <br /> |
| `groupLayout` | `int`: The resource identifier of a layout file that defines the views for a group. The layout file should include at least those named views defined in groupTo. <br /> |
| `groupFrom` | `String`: A list of column names that will be used to display the data for a group. <br /> |
| `groupTo` | `int`: The group views (from the group layouts) that should display column in the "from" parameter. These should all be TextViews or ImageViews. The first N views in this list are given the values of the first N columns in the from parameter. <br /> |
| `childLayout` | `int`: The resource identifier of a layout file that defines the views for a child. The layout file should include at least those named views defined in childTo. <br /> |
| `childFrom` | `String`: A list of column names that will be used to display the data for a child. <br /> |
| `childTo` | `int`: The child views (from the child layouts) that should display column in the "from" parameter. These should all be TextViews or ImageViews. The first N views in this list are given the values of the first N columns in the from parameter. <br /> |

## Public methods

### getViewBinder

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SimpleCursorTreeAdapter.ViewBinder getViewBinder ()
```

Returns the `https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter.ViewBinder` used to bind data to views.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter.ViewBinder` | a ViewBinder or null if the binder does not exist <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#setViewBinder(android.widget.SimpleCursorTreeAdapter.ViewBinder)`

### setViewBinder

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setViewBinder (SimpleCursorTreeAdapter.ViewBinder viewBinder)
```

Sets the binder used to bind data to views.

<br />

| Parameters ||
|---|---|
| `viewBinder` | `SimpleCursorTreeAdapter.ViewBinder`: the binder used to bind data to views, can be null to remove the existing binder <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter#getViewBinder()`

### setViewText

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setViewText (TextView v, 
                String text)
```

Called by bindView() to set the text for a TextView but only if there is no existing ViewBinder or if the existing ViewBinder cannot handle binding to a TextView. Intended to be overridden by Adapters that need to filter strings retrieved from the database.

<br />

| Parameters ||
|---|---|
| `v` | `TextView`: TextView to receive text <br /> |
| `text` | `String`: the text to be set for the TextView <br /> |

## Protected methods

### bindChildView

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void bindChildView (View view, 
                Context context, 
                Cursor cursor, 
                boolean isLastChild)
```

Bind an existing view to the child data pointed to by cursor

<br />

| Parameters ||
|---|---|
| `view` | `View`: Existing view, returned earlier by newChildView <br /> |
| `context` | `Context`: Interface to application's global information <br /> |
| `cursor` | `Cursor`: The cursor from which to get the data. The cursor is already moved to the correct position. <br /> |
| `isLastChild` | `boolean`: Whether the child is the last child within its group. <br /> |

### bindGroupView

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void bindGroupView (View view, 
                Context context, 
                Cursor cursor, 
                boolean isExpanded)
```

Bind an existing view to the group data pointed to by cursor.

<br />

| Parameters ||
|---|---|
| `view` | `View`: Existing view, returned earlier by newGroupView. <br /> |
| `context` | `Context`: Interface to application's global information <br /> |
| `cursor` | `Cursor`: The cursor from which to get the data. The cursor is already moved to the correct position. <br /> |
| `isExpanded` | `boolean`: Whether the group is expanded. <br /> |

### setViewImage

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void setViewImage (ImageView v, 
                String value)
```

Called by bindView() to set the image for an ImageView. By default, the value will be treated as a Uri. Intended to be overridden by Adapters that need to filter strings retrieved from the database.

<br />

| Parameters ||
|---|---|
| `v` | `ImageView`: ImageView to receive an image <br /> |
| `value` | `String`: the value retrieved from the cursor <br /> |