Body
First, the structure public interface Expandablelistadapter
Indirect sub-class: Baseexpandablelistadapter,cursortreeadapter,resourcecursortreeadapter, Simplecursortreeadapter, Simpleexpandablelistadapte
Ii. Overview
This adapter has a cohesive effect between the expandablelistview and the underlying data. The implementation classes of this interface provide data that accesses child elements (which are categorized as groups), as well as creating corresponding views for child elements and groups.
Iii. Public methods
Public abstract Boolean areallitemsenabled ()
Are all the entries in the expandablelistadapter available? If yes, it means that all entries can be selected and clicked. Return value: True indicates that all entries are available.
Public abstract Cursor getchild (int groupposition, int childposition)
Gets the specified child element data in the specified group. The return value returns the specified child element data.
Public abstract long Getchildid (int groupposition, int childposition)
Gets the specified child element ID in the specified group, which must be unique within the group. The Union ID (Getcombinedchildid (long, long)) is also unique across all entries (all groups and all elements).
Public abstract View Getchildview (int groupposition, int childposition, Boolean islastchild, view Convertview, ViewGroup Parent) Gets a view object that displays the specified child element data in the specified group. Parameter: Groupposition group position (inside this group contains child elements)
Childposition Location of child elements (decide which view to return)
Islastchild whether the child element is the last in the group
Convertview Reuse an existing view object. Note: You should check that the object is not empty and that the type of the object is appropriate before using it. By this extension, if the object cannot be converted and the correct data is displayed, this method invokes Getchildview (int, int, Boolean, view, ViewGroup) to create a View object.
The View object returned by the parent is always attached to the view group.
Return value: The View object returned by the child element at the specified position
public abstract int Getchildrencount (int groupposition)
Gets the number of child elements in the specified group
Parameters: Groupposition Group position (determines the number of child elements of which group to return)
Return value: Specifies the number of child elements of the group
Public abstract long Getcombinedchildid (long groupId, long childID)
Get a unique child ID number from the list of all items (groups or subkeys). A collapsible list requires that each element (group or subkey) has a unique ID in all child elements and groups. This method is responsible for returning a unique ID based on the given child ID number and group ID number. Also, if Hasstableids () is true, you must return a stable ID.
Parameter: GroupId The group ID that contains the child element
ID of the childID child element
Return value: The unique (and possibly stable) child element ID number in all items (groups or subkeys) in the list. (Translator Note: The ID is theoretically stable and does not conflict.) In other words, the list will have groups, child elements, and their IDs are unique. )
Public abstract Cursor getgroup (int groupposition)
Gets the data parameter in the specified group: Groupposition Group Location
Return value: Returns the data in the group, which is the child element data in the group
public abstract int GetGroupCount ()
Get number of Groups return value: Number of groups
Public abstract long Getgroupid (int groupposition)
Gets the ID of the specified group, and the group ID must be unique. The Union ID (see Getcombinedgroupid (Long)) is also unique across all entries (all groups and all elements).
Parameter: Groupposition Group location
Return value: Returns the group correlation ID
Public abstract View Getgroupview (int groupposition, Boolean isexpanded, View Convertview, ViewGroup parent)
Gets the view object that displays the specified group. This method only returns the View object about the group, and you need to call Getchildview (int, int, Boolean, view, ViewGroup) to get the view object of the child element.
Parameters
groupposition Group position (decide which view to return)
isexpanded Whether the group is expanded or scaled
Convertview Reuse existing view objects. Note: You should check that the object is not empty and that the type of the object is appropriate before using it. By this extension, if the object cannot be converted and the correct data is displayed, this method invokes Getgroupview (int, Boolean, view, ViewGroup) to create a View object.
The View object returned by the parent is always attached to the view group.
Return value: Returns the View object for the specified group
Public abstract Boolean Hasstableids ()
Whether groups and child elements hold stable IDs, that is, changes to the underlying data do not affect them.
Return value: Returns a Boolean value that, if true, means that the same ID always references the same object public abstract Boolean ischildselectable (int groupposition, int Childposition)
Whether to select child elements at the specified position.
Parameter: Groupposition group position (This child element is contained within the group)
Childposition Location of child elements
Return value: Whether the neutron element is selected
Public abstract Boolean IsEmpty ()
Return value: Returns True if the current adapter does not contain any data. Often used to determine whether an empty view should be displayed. A typical implementation will return the result of the expression getcount () = = 0, but because GetCount () contains the head and tail, the adapter may require different behavior.
public abstract void ongroupcollapsed (int groupposition)
This method is called when the group shrinks state.
Parameter: Groupposition group index for shrinking state
public abstract void ongroupexpanded (int groupposition)
This method is called when the group expands state.
Parameter: Groupposition group location for expanded status
public abstract void Registerdatasetobserver (Datasetobserver observer)
Registers an observer (Observer) that calls this observer when the adapter data is modified.
Parameter: Observer notifies the calling object when data is modified
public abstract void Unregisterdatasetobserver (Datasetobserver observer)
Cancels the Observer object that was previously registered in the adapter through Registerdatasetobserver (datasetobserver). Parameter: Observer cancel the registration of this viewer
Iv. Supplementary Expandablelistview.onchildclicklistener
Structure
Inheritance relationship
public static Interface Expandablelistview.onchildclicklistener
class overview
This is an interface that defines the callback method that is called when the child element of the collapsible list (expandable) has a click event.
Public methods
Public abstract Boolean Onchildclick (expandablelistview parent, View v, int groupposition, int childposition, long id)
The callback method that is called when the child element of the collapsible list is clicked.
Parameters
Expandablelistview of the Click action of the parent
v views clicked in expandable List/listview (view)
Groupposition the position (index) of the group that contains the clicked child element in the Expandablelistview
Childposition the location of the child element (children) in the group
ID is clicked child element (children) row ID (index)
return value
Returns True when a click event is processed
Expandablelistview.ongroupclicklistener
Structure
Inheritance relationship
public static Interface Expandablelistview.ongroupclicklistener
class overview
This is an interface that defines the callback method that is called when the group (s) in the collapsible list (expandable) has a click event.
Public methods
Public abstract Boolean Ongroupclick (expandablelistview parent, View v, int groupposition, long id)
The callback method that is called when the group of the collapsible list is clicked.
Parameters
Expandablelistconnector of the Click event of parent occurrence
v views clicked in expandable List/listview (view)
groupposition (group) position in Expandablelistconnector (index)
ID of the row ID of the group (group) that was clicked (indexed)
return value
Returns True when the Click event is processed
Expandablelistview.ongroupcollapselistener
Structure
Inheritance relationship
public interface Expandablelistview.ongroupcollapselistener
class overview
When a group is shrunk, a notification is issued.
Public methods
public abstract void Ongroupcollapse (int groupposition)
This method is called whenever a group in the current scalable list is shrunk.
Parameters
The position of the Groupposition group, that is, the location of the shrinking group.
Expandablelistview.ongroupexpandlistener
Structure
Inheritance relationship
public interface Expandablelistview.ongroupexpandlistener
class overview
When a group is expanded, a notification is issued.
Public methods
public abstract void Ongroupexpand (int groupposition)
This method is called whenever a group in the current scalable list is expanded.
Parameters
The position of the Groupposition group, that is, the location of the expanded group.
Http://blog.sina.com.cn/s/blog_b37dcd9701017s61.html
Expandablelistview Method Detailed