(A practical code of Android infinite tree menu, which specifically demonstrates the process of making a tree menu. All the important points used are annotated. Learning to make a tree menu is a perfect example. You can understand how to set the parent node, get the parent node, set the node text, set the node icon file, clear all child nodes, delete the child nodes at the specified location, set whether there is a check box, whether it is a leaf node, that is, a node without a child node, recursively determine whether the given node is the parent node of the current node, recursively determine whether the parent node is in a collapsed state, and if there is a collapsed parent node, it is considered a collapsed state. Description of function definition: privateNode parent// Parent node privateListchildren=newArrayList()// The child node privateStringtext// The text privateStringvalue displayed by the node// The value of the node privateenticon=- 1// Whether to display small icons, - 1 means to hide the icon privatepoolenisChecked=false// Whether it is selected privatepoolenisExpanded=true// Whether it is in the open status privatebooleanhasCheckBox=true// Check box
Node Frame Functions
@Text displayed by paramtext node
@The value of the paramvalue node)