android - Child selection in ExpandableListView -


Text after "

In a ExpandableListView it is possible to select a child's item in the beginning so that the group containing Expansion happens

I thought setSelectedChild will do this but it does not produce any results.

The following part of the code I tested:

  the public class increases the main activity activity {Private Static Last String Title = "Title"; @SuppressWarnings ("Serial") @ Override Protected on Zero (Bundle Saved Instantstate) {Super. Secret (Saved Instantstate); ExpandableListView ListView = New Extension EligibilityListview (this); SimpleExpandableListAdapter adapter = New SimpleExpandableListAdapter (this, new ArrayList & lt; map & lt; string, string & gt; & gt; () {{this.add (new HashMap & lt; string, string & gt; () {{this .put (title, "group 1");}}); this.add (new HashMap & lt; string, string & gt; () {{this.put (title, "group2");}}); This.add (new HashMap & lt; string, string & gt; () {{this.put (title, "group 3");}})}}}, android.R.layout.simple_expandable_list_item_1, new string [] {Title}, new integer [] {android.R.id.text1}, new ArrayList & quot; string, string & gt; & gt; & gt; () {{this.add (new ArrayList & lt; map & LT; string, string C & gt; & gt; () {{this.add (new HashMap & LT; string, string & gt list & lt;? Map & lt extends) {{This.put (TITLE, "Hair 1-1 ");}}); This.add (new hashmop  () {{this.put (TITLE," hair 1-2 ");}}}}}}); this Add (new ArrayList & lt; map & lt; string, string & gt; & gt; {) {{this.add (new HashMap & lt; string, string & gt; () {{This.put (title, "hair 2-1");}}); This.add (new hashmop & lt; string, string & gt; () {{ppt (title, "hair 2-2")}}); }}); This.add (new array list & lt; map & lt; string, string & gt; & gt; () {{this.add (new hashmop & lt; string, string & gt; () {{this.put ( TITLE, "Child 3-1")}}; This.add (new hashmop  () {{this.put (TITLE, "3-2 children")}}})} }}); }}, Android.R.layout.simple_expandable_list_item_2, new string [] {TITLE}, new entry [] (android.R.id.text1}); ListView.setAdapter (adapter); SetContentView (ListView); ListView.setSelectedChild (1, 1, true); }}    

Add the call to listView.expandGroup () Girl selected before the set () . . Highly-supplied group parameter is set to true set selectedChild () If only it seems to work at least one group has expanded in the first place.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -