IT. Expert System.

Android Reference

CursorTreeAdapter


android.widget

Class CursorTreeAdapter

    • Constructor Detail

      • CursorTreeAdapter

        public CursorTreeAdapter(Cursor cursor,
                         Context context)
        Constructor. The adapter will call Cursor.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.
      • CursorTreeAdapter

        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 Cursor.requery() on the cursor whenever it changes so the most recent data is always displayed.
    • Method Detail

      • getChildrenCursor

        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.

        If you want to asynchronously query a provider to prevent blocking the UI, it is possible to return null and at a later time call setChildrenCursor(int, Cursor).

        It is your responsibility to manage this Cursor through the Activity lifecycle. It is a good idea to use Activity.managedQuery(android.net.Uri, java.lang.String[], java.lang.String, java.lang.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, or null.
      • setGroupCursor

        public void setGroupCursor(Cursor cursor)
        Sets the group Cursor.
        Parameters:
        cursor - The Cursor to set for the group. If there is an existing cursor it will be closed.
      • setChildrenCursor

        public void setChildrenCursor(int groupPosition,
                             Cursor childrenCursor)
        Sets the children Cursor for a particular group. If there is an existing cursor it will be closed.

        This is useful when asynchronously querying to prevent blocking the UI.

        Parameters:
        groupPosition - The group whose children are being set via this Cursor.
        childrenCursor - The Cursor that contains the children of the group.
      • getChild

        public Cursor getChild(int groupPosition,
                      int childPosition)
        Description copied from interface: ExpandableListAdapter
        Gets the data associated with the given child within the given group.
        Specified by:
        getChild in interface ExpandableListAdapter
        Parameters:
        groupPosition - the position of the group that the child resides in
        childPosition - the position of the child with respect to other children in the group
        Returns:
        the data of the child
      • getChildId

        public long getChildId(int groupPosition,
                      int childPosition)
        Description copied from interface: ExpandableListAdapter
        Gets the ID for the given child within the given group. This ID must be unique across all children within the group. The combined ID (see ExpandableListAdapter.getCombinedChildId(long, long)) must be unique across ALL items (groups and all children).
        Specified by:
        getChildId in interface ExpandableListAdapter
        Parameters:
        groupPosition - the position of the group that contains the child
        childPosition - the position of the child within the group for which the ID is wanted
        Returns:
        the ID associated with the child
      • getChildrenCount

        public int getChildrenCount(int groupPosition)
        Description copied from interface: ExpandableListAdapter
        Gets the number of children in a specified group.
        Specified by:
        getChildrenCount in interface ExpandableListAdapter
        Parameters:
        groupPosition - the position of the group for which the children count should be returned
        Returns:
        the children count in the specified group
      • getGroup

        public Cursor getGroup(int groupPosition)
        Description copied from interface: ExpandableListAdapter
        Gets the data associated with the given group.
        Specified by:
        getGroup in interface ExpandableListAdapter
        Parameters:
        groupPosition - the position of the group
        Returns:
        the data child for the specified group
      • getGroupId

        public long getGroupId(int groupPosition)
        Description copied from interface: ExpandableListAdapter
        Gets the ID for the group at the given position. This group ID must be unique across groups. The combined ID (see ExpandableListAdapter.getCombinedGroupId(long)) must be unique across ALL items (groups and all children).
        Specified by:
        getGroupId in interface ExpandableListAdapter
        Parameters:
        groupPosition - the position of the group for which the ID is wanted
        Returns:
        the ID associated with the group
      • getGroupView

        public View getGroupView(int groupPosition,
                        boolean isExpanded,
                        View convertView,
                        ViewGroup parent)
        Description copied from interface: ExpandableListAdapter
        Gets a View that displays the given group. This View is only for the group--the Views for the group's children will be fetched using ExpandableListAdapter.getChildView(int, int, boolean, View, ViewGroup).
        Specified by:
        getGroupView in interface ExpandableListAdapter
        Parameters:
        groupPosition - the position of the group for which the View is returned
        isExpanded - whether the group is expanded or collapsed
        convertView - the old view to reuse, if possible. 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. It is not guaranteed that the convertView will have been previously created by ExpandableListAdapter.getGroupView(int, boolean, View, ViewGroup).
        parent - the parent that this view will eventually be attached to
        Returns:
        the View corresponding to the group at the specified position
      • newGroupView

        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
        Returns:
        The newly created view.
      • bindGroupView

        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.
      • getChildView

        public View getChildView(int groupPosition,
                        int childPosition,
                        boolean isLastChild,
                        View convertView,
                        ViewGroup parent)
        Description copied from interface: ExpandableListAdapter
        Gets a View that displays the data for the given child within the given group.
        Specified by:
        getChildView in interface ExpandableListAdapter
        Parameters:
        groupPosition - the position of the group that contains the child
        childPosition - the position of the child (for which the View is returned) within the group
        isLastChild - Whether the child is the last child within the group
        convertView - the old view to reuse, if possible. 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. It is not guaranteed that the convertView will have been previously created by ExpandableListAdapter.getChildView(int, int, boolean, View, ViewGroup).
        parent - the parent that this view will eventually be attached to
        Returns:
        the View corresponding to the child at the specified position
      • newChildView

        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
        Returns:
        the newly created view.
      • bindChildView

        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.
      • isChildSelectable

        public boolean isChildSelectable(int groupPosition,
                                int childPosition)
        Description copied from interface: ExpandableListAdapter
        Whether the child at the specified position is selectable.
        Specified by:
        isChildSelectable in interface ExpandableListAdapter
        Parameters:
        groupPosition - the position of the group that contains the child
        childPosition - the position of the child within the group
        Returns:
        whether the child is selectable.
      • notifyDataSetChanged

        public void notifyDataSetChanged(boolean releaseCursors)
        Notifies a data set change, but with the option of not releasing any cached cursors.
        Parameters:
        releaseCursors - Whether to release and deactivate any cached cursors.
      • getFilter

        public Filter getFilter()
        Description copied from interface: Filterable

        Returns a filter that can be used to constrain data with a filtering pattern.

        This method is usually implemented by Adapter classes.

        Specified by:
        getFilter in interface Filterable
        Returns:
        a filter used to constrain data


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 638 / . Delta: 0.03762 с