The example of this article describes the implementation of the indicator icon for Android change Expandablelistview. Share to everyone for your reference, specific as follows:
1 Define XML file first, named Expand_list_indicator.xml
<?xml version= "1.0" encoding= "UTF-8"?> <selector xmlns:android=
"http://schemas.android.com/apk/res/" Android >
<item android:state_expanded= "true" android:drawable= "@drawable/indicator_open"/>
<item android:state_expanded= "false" android:drawable= "@drawable/indicator_close"/>
</selector>
2 The XML file is invoked after the Expandablelistview instance ID is obtained
Expandablelistview mexpandlist = (expandablelistview) Findviewbyid (r.id.expandlist);
Mexpandlist.setgroupindicator (This.getresources (). getdrawable (R.drawable.expand_list_indicator));
Note : Because the indicator background picture will automatically stretch, if you do not want to stretch the picture, then the Indicator_open, Indicator_close pictures for special treatment, made. 9.png format is OK.
For more information on Android-related content readers can view the site topics: "Android Debugging techniques and common problems solution summary", "Android Development introduction and Advanced Course", "Android Multimedia operating skills Summary (audio, video, recording, etc.)", " Android Basic Components Usage Summary, Android View tips Summary, Android layout layout tips and Android Control usage summary
I hope this article will help you with the Android program.