1. Are you ready for the Galaxy S20? Here is everything we know so far!

Populating ExpandableListView with data from ListView

Discussion in 'Android Development' started by louis84, Sep 21, 2011.

  1. louis84

    louis84 Lurker
    Thread Starter

    Hi All,

    I am new to android development, I have a listview which is populated dynamically from an external xml file stored on wamp server which is working fine.
    However, am having difficulty pushing the items on the list into the expandable listview.

    Any help will be appreciated.

    The code for the listview is:
    Code (Text):
    1.  
    2. package com.pxr.tutorial.xmltest;
    3. import java.util.ArrayList;
    4. import java.util.HashMap;
    5. //import mCRM.android.hp.Contacts1;
    6. import org.w3c.dom.Document;
    7. import org.w3c.dom.Element;
    8. import org.w3c.dom.NodeList;
    9. import com.pxr.tutorial.xmltest.R;
    10. import android.app.ListActivity;
    11. import android.content.Intent;
    12. import android.os.Bundle;
    13. import android.view.View;
    14. import android.widget.AdapterView;
    15. import android.widget.AdapterView.OnItemClickListener;
    16. import android.widget.ListAdapter;
    17. import android.widget.ListView;
    18. import android.widget.SimpleAdapter;
    19. import android.widget.Toast;
    20.  
    21. public class Opp_level0 extends ListActivity  {
    22.     /** Called when the activity is first created. */
    23.     @Override
    24.     public void onCreate(Bundle savedInstanceState) {
    25.         super.onCreate(savedInstanceState);
    26.         setContentView(R.layout.listplaceholder);
    27.        int id = getIntent().getIntExtra("id", 0);          ///rem          
    28.  
    29.         ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();
    30.  
    31.  
    32.         String xml = XMLfunctions.getXML();
    33.         Document doc = XMLfunctions.XMLfromString(xml);
    34.  
    35.         int numResults = XMLfunctions.numResults(doc);
    36.  
    37.         if((numResults <= 0)){
    38.          Toast.makeText(Opp_level0.this, "Geen resultaten gevonden", Toast.LENGTH_LONG).show();  
    39.          finish();
    40.         }
    41.  
    42.   NodeList nodes = doc.getElementsByTagName("result");
    43.  
    44.   for (int i = 0; i < nodes.getLength(); i++) {      
    45.    HashMap<String, String> map = new HashMap<String, String>();
    46.  
    47.    Element e = (Element)nodes.item(i);
    48.    map.put("id", XMLfunctions.getValue(e, "id"));
    49.          map.put("name", "Account Record: " + XMLfunctions.getValue(e, "name"));
    50.          map.put("Score", "Subrecord: " + XMLfunctions.getValue(e, "score"));
    51.          mylist.add(map);  
    52.   }  
    53.  
    54.       ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.opp_level0,
    55.                         new String[] { "name", "Score" },
    56.                         new int[] { R.id.item_title, R.id.item_subtitle });
    57.  
    58.         setListAdapter(adapter);
    59.  
    60.         final ListView lv = getListView();
    61.         lv.setTextFilterEnabled(true);
    62.         lv.setOnItemClickListener(new OnItemClickListener() {
    63.  
    64.          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {          
    65.           @SuppressWarnings("unchecked")
    66.     HashMap<String, String> o = (HashMap<String, String>) lv.getItemAtPosition(position);          
    67.           Toast.makeText(Opp_level0.this, "Record '" + o.get("id") + "' was clicked.", Toast.LENGTH_SHORT).show();
    68.  
    69.  
    70.  
    71.  
    72.           if(id==0){
    73.  
    74.             Intent myIntent = new Intent(view.getContext(), opp1.class); // when a row is tapped, load tes.class              
    75.                startActivityForResult(myIntent, (int) id); // display tes.class
    76.  
    77.          }
    78.           else if (id==1){
    79.            Intent myIntent = new Intent(view.getContext(), opp2.class); // when a row is tapped, load tttt.class              
    80.                startActivityForResult(myIntent, (int) id); // display tttt.class
    81.  
    82.           }                  
    83.  
    84.    }
    85.  
    86.  
    87.  
    88.   });
    89.  
    90.     }
    91.  
    92. }
    93.  
    the code for the expandable list is:
    Code (Text):
    1.  
    2.  
    3. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]package[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055]
    4. [LEFT][/COLOR][/SIZE][SIZE=2]com.pxr.tutorial.xmltest;[/SIZE][/LEFT]
    5.  
    6.  
    7.  
    8. [LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//package mCRM.android.hp;[/COLOR][/SIZE][/COLOR][/SIZE][/LEFT]
    9. [SIZE=2][COLOR=#3f7f5f]
    10. [/COLOR][/SIZE]
    11.  
    12. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]java.util.ArrayList;[/SIZE][/LEFT]
    13.  
    14. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]java.util.HashMap;[/SIZE]
    15.  
    16. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]org.w3c.dom.Document;[/SIZE]
    17. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]org.w3c.dom.Element;[/SIZE]
    18.  
    19. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]org.w3c.dom.NodeList;[/SIZE]
    20.  
    21. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]com.pxr.tutorial.xmltest.R;[/SIZE]
    22. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.app.ExpandableListActivity;[/SIZE]
    23. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.content.Intent;[/SIZE]
    24.  
    25. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.os.Bundle;[/SIZE]
    26. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.view.ContextMenu;[/SIZE]
    27.  
    28. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.view.Gravity;[/SIZE]
    29.  
    30. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.view.MenuItem;[/SIZE]
    31.  
    32. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.view.View;[/SIZE]
    33.  
    34. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.view.ViewGroup;[/SIZE]
    35.  
    36. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.view.ContextMenu.ContextMenuInfo;[/SIZE]
    37.  
    38. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.AbsListView;[/SIZE]
    39.  
    40. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.AdapterView;[/SIZE]
    41.  
    42. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.BaseExpandableListAdapter;[/SIZE]
    43.  
    44. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.ExpandableListAdapter;[/SIZE]
    45.  
    46. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.ExpandableListView;[/SIZE]
    47.  
    48. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.ExpandableListView.OnGroupClickListener;[/SIZE]
    49.  
    50. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.ListAdapter;[/SIZE]
    51.  
    52. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.ListView;[/SIZE]
    53.  
    54. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.SimpleAdapter;[/SIZE]
    55.  
    56. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.AdapterView.OnItemClickListener;[/SIZE]
    57.  
    58. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.ExpandableListView.OnChildClickListener;[/SIZE]
    59.  
    60. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.TextView;[/SIZE]
    61.  
    62. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.Toast;[/SIZE]
    63.  
    64. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.ExpandableListView.ExpandableListContextMenuInfo;[/SIZE]
    65.  
    66. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]android.widget.SimpleExpandableListAdapter;[/SIZE]
    67.  
    68.  
    69.  
    70. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]class[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] opp1 [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]extends[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ExpandableListActivity [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]implements[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] OnChildClickListener { [/SIZE]
    71.  
    72.  
    73.  
    74.  
    75.  
    76. [LEFT][SIZE=2]ExpandableListAdapter [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]mAdanna[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]; [/SIZE][/LEFT]
    77.  
    78.  
    79.  
    80. [LEFT][SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]@Override[/COLOR][/SIZE][/COLOR][/SIZE]
    81. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] onCreate(Bundle savedInstanceState) { [/SIZE][/LEFT]
    82. [/LEFT]
    83.  
    84.  
    85.  
    86.  
    87. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]super[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2].onCreate(savedInstanceState); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Set up our adapter [/COLOR][/SIZE][/COLOR][/SIZE][/LEFT]
    88.  
    89.  
    90.  
    91.  
    92. [SIZE=2][COLOR=#3f7f5f][LEFT][SIZE=2][COLOR=#3f7f5f]//setContentView(R.layout.opppp);[/COLOR][/SIZE]
    93. [LEFT][/COLOR][/SIZE][SIZE=2]ExpandableListAdapter mAdanna; [/SIZE]
    94. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]final [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]ExpandableListView epView = (ExpandableListView) findViewById(R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]expandableListView1[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE][/LEFT]
    95. [/LEFT]
    96.  
    97.  
    98.  
    99.  
    100. [LEFT][SIZE=2]mAdanna = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] MyExpandableListAdapter();[/SIZE]
    101. [LEFT][SIZE=2]epView.setAdapter(mAdanna);[/SIZE][/LEFT]
    102. [/LEFT]
    103.  
    104.  
    105.  
    106. [LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//setListAdapter(mAdanna); [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
    107. [LEFT][/COLOR][/SIZE][SIZE=2]registerForContextMenu(getExpandableListView()); [/SIZE][/LEFT]
    108. [/LEFT]
    109.  
    110.  
    111.  
    112. [LEFT][SIZE=2]ArrayList<HashMap<String, String>> mylist = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ArrayList<HashMap<String, String>>();[/SIZE][/LEFT]
    113.  
    114.  
    115.  
    116.  
    117. [LEFT][SIZE=2]String xml = XMLfunctions.[I]getXML[/I]();[/SIZE]
    118. [LEFT][SIZE=2]Document doc = XMLfunctions.[I]XMLfromString[/I](xml);[/SIZE][/LEFT]
    119. [/LEFT]
    120.  
    121.  
    122.  
    123. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]numResults = XMLfunctions.[I]numResults[/I](doc);[/SIZE][/LEFT]
    124.  
    125.  
    126.  
    127.  
    128.  
    129. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]((numResults <= 0)){[/SIZE][/LEFT]
    130.  
    131.  
    132.  
    133.  
    134. [LEFT][SIZE=2]Toast.[I]makeText[/I](opp1.[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Geen resultaten gevonden"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], Toast.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]LENGTH_LONG[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]).show(); [/SIZE]
    135. [LEFT][SIZE=2]finish();[/SIZE]
    136. [SIZE=2]}[/SIZE][/LEFT]
    137. [/LEFT]
    138.  
    139.  
    140.  
    141. [LEFT][SIZE=2]NodeList nodes = doc.getElementsByTagName([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"result"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE][/LEFT]
    142.  
    143.  
    144.  
    145. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]for [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] i = 0; i < nodes.getLength(); i++) { [/SIZE][/LEFT]
    146.  
    147.  
    148.  
    149.  
    150. [LEFT][SIZE=2]HashMap<String, String> map = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] HashMap<String, String>(); [/SIZE][/LEFT]
    151.  
    152.  
    153.  
    154. [LEFT][SIZE=2]Element e = (Element)nodes.item(i);[/SIZE]
    155. [LEFT][SIZE=2]map.put([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"id"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], XMLfunctions.[I]getValue[/I](e, [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"id"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]));[/SIZE]
    156. [SIZE=2]map.put([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"name"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Account Record: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + XMLfunctions.[I]getValue[/I](e, [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"name"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]));[/SIZE]
    157. [SIZE=2]map.put([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"score"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Subrecord: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + XMLfunctions.[I]getValue[/I](e, [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"score"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]));[/SIZE]
    158. [SIZE=2]mylist.add(map); [/SIZE]
    159. [SIZE=2]} [/SIZE]
    160. [SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/*[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
    161. [SIZE=2][COLOR=#3f7f5f]ExpandableListAdapter adapter = (ExpandableListAdapter) new SimpleAdapter(this, [U]mylist[/U] , R.layout.opppp, [/COLOR][/SIZE]
    162. [SIZE=2][COLOR=#3f7f5f]new String[] { "Details" }, [/COLOR][/SIZE]
    163. [SIZE=2][COLOR=#3f7f5f]new [U]int[/U][] { R.id.expandableListView1});[/COLOR][/SIZE][/COLOR][/SIZE][/LEFT]
    164. [/LEFT]
    165. [SIZE=2][COLOR=#3f7f5f]
    166. [/COLOR][/SIZE]
    167.  
    168. [LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]setListAdapter(adapter);[/COLOR][/SIZE][/COLOR][/SIZE][/LEFT]
    169. [SIZE=2][COLOR=#3f7f5f]
    170. [/COLOR][/SIZE]
    171.  
    172. [LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]*/[/COLOR][/SIZE][/COLOR][/SIZE][/LEFT]
    173. [SIZE=2][COLOR=#3f7f5f]
    174. [/COLOR][/SIZE]
    175.  
    176. [LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]///----------------this is where my problem lies----------------------------//////////[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
    177. [LEFT][/COLOR][/SIZE][SIZE=2]epView.setOnGroupClickListener([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] OnGroupClickListener(){[/SIZE][/LEFT]
    178. [/LEFT]
    179.  
    180.  
    181.  
    182.  
    183. [LEFT][SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]@Override[/COLOR][/SIZE][/COLOR][/SIZE]
    184. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]boolean[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] onGroupClick(ExpandableListView arg0, View arg1, [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] groupPosition, [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]long[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] arg3){[/SIZE]
    185. [SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]@SuppressWarnings[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"unchecked"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE]
    186. [SIZE=2]HashMap<String, String> o = (HashMap<String, String>) epView.getItemAtPosition(groupPosition); [/SIZE]
    187. [SIZE=2]Toast.[I]makeText[/I](opp1.[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Record '"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + o.get([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"id"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) + [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"' was clicked."[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], Toast.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]LENGTH_SHORT[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]).show();[/SIZE]
    188. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2](groupPosition == 0){[/SIZE]
    189. [SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//o.p[/COLOR][/SIZE][/COLOR][/SIZE]
    190. [SIZE=2]o.[U]get[/U]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"name"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE][/LEFT]
    191.  
    192.  
    193. [SIZE=2]}[/SIZE]
    194. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]true[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2];[/SIZE]
    195. [SIZE=2]}[/SIZE]
    196. [SIZE=2]});[/SIZE]
    197. [SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/////----------------------------------end----------------------------------////////// [/COLOR][/SIZE][/COLOR][/SIZE][/LEFT]
    198. [/LEFT]
    199. [SIZE=2][COLOR=#3f7f5f]
    200. [/COLOR][/SIZE]
    201.  
    202. [LEFT][SIZE=2]} [/SIZE][/LEFT]
    203.  
    204.  
    205.  
    206. [LEFT][SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]@Override[/COLOR][/SIZE][/COLOR][/SIZE]
    207. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { [/SIZE][/LEFT]
    208. [/LEFT]
    209.  
    210.  
    211.  
    212.  
    213. [LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//menu.setHeaderTitle("Sample menu"); [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
    214. [LEFT][/COLOR][/SIZE][SIZE=2]menu.add(0, 0, 0, R.string.[/SIZE][/LEFT]
    215. [/LEFT]
    216.  
    217.  
    218. [LEFT][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]app_name[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]); } [/SIZE][/LEFT]
    219.  
    220.  
    221. [LEFT][SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]@Override[/COLOR][/SIZE][/COLOR][/SIZE]
    222. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]boolean[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] onContextItemSelected(MenuItem item) { [/SIZE][/LEFT]
    223. [/LEFT]
    224.  
    225.  
    226.  
    227.  
    228.  
    229. [LEFT][SIZE=2]ExpandableListContextMenuInfo info = (ExpandableListContextMenuInfo) item.getMenuInfo(); [/SIZE]
    230. [LEFT][SIZE=2]String title = ((TextView) info.[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]targetView[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]).getText().toString(); [/SIZE]
    231. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]type = ExpandableListView.[I]getPackedPositionType[/I](info.[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]packedPosition[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]); [/SIZE][/LEFT]
    232. [/LEFT]
    233.  
    234.  
    235.  
    236.  
    237.  
    238. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2](type == ExpandableListView.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PACKED_POSITION_TYPE_CHILD[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]) { [/SIZE][/LEFT]
    239.  
    240.  
    241.  
    242.  
    243. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]groupPos = ExpandableListView.[I]getPackedPositionGroup[/I](info.[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]packedPosition[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]); [/SIZE][/LEFT]
    244.  
    245.  
    246.  
    247.  
    248. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]childPos = ExpandableListView.[I]getPackedPositionChild[/I](info.[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]packedPosition[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]); [/SIZE][/LEFT]
    249.  
    250.  
    251.  
    252.  
    253.  
    254. [LEFT][SIZE=2]Toast.[I]makeText[/I]([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2], title + [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]": Child "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + childPos + [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]" clicked in group "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + groupPos,Toast.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]LENGTH_SHORT[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]).show(); [/SIZE]
    255. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]true[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]; [/SIZE][/LEFT]
    256. [/LEFT]
    257.  
    258.  
    259.  
    260.  
    261. [LEFT][SIZE=2]} [/SIZE]
    262. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (type == ExpandableListView.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PACKED_POSITION_TYPE_GROUP[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]) { [/SIZE][/LEFT]
    263. [/LEFT]
    264.  
    265.  
    266.  
    267.  
    268. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]groupPos = ExpandableListView.[I]getPackedPositionGroup[/I](info.[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]packedPosition[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]); [/SIZE][/LEFT]
    269.  
    270.  
    271.  
    272.  
    273.  
    274. [LEFT][SIZE=2]Toast.[I]makeText[/I]([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2], title + [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]": Group "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + groupPos + [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]" clicked"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], Toast.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]LENGTH_SHORT[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]).show(); [/SIZE]
    275. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]true[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]; [/SIZE][/LEFT]
    276. [/LEFT]
    277.  
    278.  
    279.  
    280.  
    281. [LEFT][SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]false[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]; [/SIZE][/LEFT]
    282.  
    283.  
    284.  
    285.  
    286.  
    287.  
    288. [LEFT][SIZE=2]} [/SIZE]
    289. [LEFT][SIZE=2][COLOR=#3f5fbf][SIZE=2][COLOR=#3f5fbf]/** * A simple adapter which maintains an ArrayList of photo resource [U]Ids[/U]. [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f5fbf]
    290. [SIZE=2][COLOR=#3f5fbf]* Each photo is displayed as an image. This adapter supports clearing the [/COLOR][/SIZE]
    291. [SIZE=2][COLOR=#3f5fbf]* list of photos and adding a new photo. * */[/COLOR][/SIZE][/COLOR][/SIZE]
    292. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]class[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] MyExpandableListAdapter [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]extends[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] BaseExpandableListAdapter { [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Sample data set. children[I] contains the children (String[]) for groups[I]. [/I][/I][/COLOR][/SIZE][/COLOR][/SIZE][/LEFT]
    293. [/LEFT]
    294.  
    295.  
    296.  
    297. [I][LEFT][I][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]String[] [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]groups[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = {[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Details"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Primary Sales Rep"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Contacts"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]}; [/SIZE][/I][/I][/LEFT]
    298.  
    299.  
    300.  
    301.  
    302.  
    303. [I][LEFT][I][SIZE=2]String[][] [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]children[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = {{ },{ [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Fill 5"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Fill 6"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Fill 7"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Fill 8"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] },{ [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Fill 9"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Fill 10"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] }}; [/SIZE][/I][/I][/LEFT]
    304.  
    305.  
    306.  
    307. [I][LEFT][I][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] Object getChild([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] groupPosition, [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] childPosition) {[/SIZE][/I][/I][/LEFT]
    308.  
    309.  
    310.  
    311.  
    312.  
    313. [I][LEFT][I][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]children[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][groupPosition][childPosition]; [/SIZE][/I][/I][/LEFT]
    314.  
    315.  
    316.  
    317. [I][LEFT][I][SIZE=2]} [/SIZE][/I][/I][/LEFT]
    318.  
    319.  
    320.  
    321.  
    322.  
    323. [I][LEFT][I][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]long[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] getChildId([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] groupPosition, [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] childPosition) { [/SIZE][/I][/I]
    324. [LEFT][I][I][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] childPosition; [/SIZE][/I][/I]
    325. [I][I][SIZE=2]} [/SIZE][/I][/I]
    326. [I][I][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] getChildrenCount([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] groupPosition) { [/SIZE][/I][/I]
    327. [I][I][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]children[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][groupPosition].[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]length[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]; [/SIZE][/I][/I]
    328. [I][I][SIZE=2]}[/SIZE][/I][/I][/LEFT]
    329. [/LEFT]
    330.  
    331.  
    332.  
    333.  
    334. [I][LEFT][I][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] TextView getGenericView() { [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Layout parameters for the ExpandableListView [/COLOR][/SIZE][/COLOR][/SIZE][/I][/I]
    335. [LEFT][I][I][SIZE=2]AbsListView.LayoutParams lp = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] AbsListView.LayoutParams(ViewGroup.LayoutParams.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]MATCH_PARENT[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2], 64); [/SIZE][/I][/I][/LEFT]
    336. [/LEFT]
    337.  
    338.  
    339.  
    340.  
    341.  
    342. [I][LEFT][I][SIZE=2]TextView textView = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] TextView(opp1.[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]); [/SIZE][/I][/I]
    343. [LEFT][i][I][SIZE=2]textView.setLayoutParams(lp); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Center the text vertically [/COLOR][/SIZE][/COLOR][/SIZE][/I]
    344. [i][SIZE=2]textView.setGravity(Gravity.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]CENTER_VERTICAL[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2] | Gravity.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]LEFT[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Set the text starting position [/COLOR][/SIZE][/COLOR][/SIZE][/LEFT]
    345. [/LEFT]
    346.  
    347.  
    348.  
    349. [LEFT][SIZE=2]textView.setPadding(36, 0, 0, 0); [/SIZE]
    350. [LEFT][SIZE=2]textView.setId(23);[/SIZE][/LEFT]
    351. [/LEFT]
    352.  
    353.  
    354.  
    355. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] textView; [/SIZE]
    356. [LEFT][SIZE=2]} [/SIZE][/LEFT]
    357. [/LEFT]
    358.  
    359.  
    360.  
    361. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] View getChildView([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] groupPosition, [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] childPosition, [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]boolean[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] isLastChild,View convertView, ViewGroup parent) { [/SIZE]
    362. [LEFT][SIZE=2]TextView textView = getGenericView(); [/SIZE]
    363. [SIZE=2]textView.setText(getChild(groupPosition, childPosition).toString()); [/SIZE]
    364. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] textView; [/SIZE]
    365. [SIZE=2]} [/SIZE][/LEFT]
    366. [/LEFT]
    367.  
    368.  
    369.  
    370. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] Object getGroup([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] groupPosition) { [/SIZE]
    371. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]groups[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][groupPosition]; [/SIZE]
    372. [SIZE=2]} [/SIZE][/LEFT]
    373. [/LEFT]
    374.  
    375.  
    376.  
    377. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] getGroupCount() { [/SIZE]
    378. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]groups[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]length[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]; [/SIZE]
    379. [SIZE=2]} [/SIZE][/LEFT]
    380. [/LEFT]
    381.  
    382.  
    383.  
    384. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]long[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] getGroupId([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] groupPosition) { [/SIZE]
    385. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] groupPosition; [/SIZE]
    386. [SIZE=2]} [/SIZE][/LEFT]
    387. [/LEFT]
    388.  
    389.  
    390.  
    391. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] View getGroupView([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] groupPosition, [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]boolean[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] isExpanded, View convertView,ViewGroup parent) { [/SIZE]
    392. [LEFT][SIZE=2]TextView textView = getGenericView(); [/SIZE]
    393. [SIZE=2]textView.setText(getGroup(groupPosition).toString()); [/SIZE]
    394. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] textView; [/SIZE]
    395. [SIZE=2]} [/SIZE]
    396. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]boolean[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] isChildSelectable([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] groupPosition, [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] childPosition) { [/SIZE]
    397. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]true[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]; [/SIZE]
    398. [SIZE=2]} [/SIZE]
    399. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]boolean[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] hasStableIds() { [/SIZE]
    400. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]true[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2];[/SIZE][/LEFT]
    401. [/LEFT]
    402.  
    403.  
    404.  
    405. [LEFT][SIZE=2]}[/SIZE][/LEFT]
    406.  
    407.  
    408.  
    409. [LEFT][SIZE=2]}[/SIZE][/LEFT]
    410.  
    411.  
    412.  
    413.  
    414. [LEFT][SIZE=2]}[/SIZE][/LEFT]
    415.  
    416.  
    417.  
    418.  
    Bascically what I want to do is to push the name and score in the listview to the details primary sales rep sections of the Expandable
     

    Advertisement

Loading...

Share This Page

Loading...