[ Web Proxy ]
URL:
Viewing: https://developer.android.com/reference/android/widget/ResourceCursorTreeAdapter [Back]  [Original]

ResourceCursorTreeAdapter  |  API reference  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]
Stay organized with collections Save and categorize content based on your preferences.
Added in API level 1

ResourceCursorTreeAdapter


public abstract class ResourceCursorTreeAdapter
extends CursorTreeAdapter

java.lang.Object
   ↳ android.widget.BaseExpandableListAdapter
     ↳ android.widget.CursorTreeAdapter
       ↳ android.widget.ResourceCursorTreeAdapter


A fairly simple ExpandableListAdapter that creates views defined in an XML file. You can specify the XML file that defines the appearance of the views.

Summary

Public constructors

ResourceCursorTreeAdapter(Context context, Cursor cursor, int groupLayout, int childLayout)

Constructor.

ResourceCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, int expandedGroupLayout, int childLayout)

Constructor.

ResourceCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, int expandedGroupLayout, int childLayout, int lastChildLayout)

Constructor.

Public methods

View newChildView(Context context, Cursor cursor, boolean isLastChild, ViewGroup parent)

Makes a new child view to hold the data pointed to by cursor.

View newGroupView(Context context, Cursor cursor, boolean isExpanded, ViewGroup parent)

Makes a new group view to hold the group data pointed to by cursor.

Inherited methods

Public constructors

ResourceCursorTreeAdapter

Added in API level 1
public ResourceCursorTreeAdapter (Context context, 
                Cursor cursor, 
                int groupLayout, 
                int childLayout)

Constructor.

Parameters
context Context: The context where the ListView associated with this SimpleListItemFactory is running

cursor Cursor: The database cursor

groupLayout int: resource identifier of a layout file that defines the views for all groups.

childLayout int: resource identifier of a layout file that defines the views for all children.

ResourceCursorTreeAdapter

Added in API level 1
public ResourceCursorTreeAdapter (Context context, 
                Cursor cursor, 
                int collapsedGroupLayout, 
                int expandedGroupLayout, 
                int childLayout)

Constructor.

Parameters
context Context: The context where the ListView associated with this SimpleListItemFactory is running

cursor Cursor: The database cursor

collapsedGroupLayout int: resource identifier of a layout file that defines the views for collapsed groups.

expandedGroupLayout int: resource identifier of a layout file that defines the views for expanded groups.

childLayout int: resource identifier of a layout file that defines the views for all children.

ResourceCursorTreeAdapter

Added in API level 1
public ResourceCursorTreeAdapter (Context context, 
                Cursor cursor, 
                int collapsedGroupLayout, 
                int expandedGroupLayout, 
                int childLayout, 
                int lastChildLayout)

Constructor.

Parameters
context Context: The context where the ListView associated with this SimpleListItemFactory is running

cursor Cursor: The database cursor

collapsedGroupLayout int: resource identifier of a layout file that defines the views for collapsed groups.

expandedGroupLayout int: resource identifier of a layout file that defines the views for expanded groups.

childLayout int: resource identifier of a layout file that defines the views for all children but the last..

lastChildLayout int: resource identifier of a layout file that defines the views for the last child of a group.

Public methods

newChildView

Added in API level 1
public 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 Context: Interface to application's global information

cursor Cursor: The cursor from which to get the data. The cursor is already moved to the correct position.

isLastChild boolean: Whether the child is the last child within its group.

parent ViewGroup: The parent to which the new view is attached to

Returns
View the newly created view.

newGroupView

Added in API level 1
public 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 Context: Interface to application's global information

cursor Cursor: The group cursor from which to get the data. The cursor is already moved to the correct position.

isExpanded boolean: Whether the group is expanded.

parent ViewGroup: The parent to which the new view is attached to

Returns
View The newly created view.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-03 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-03 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page