title: Retrieve data from SQLite to Expandable list view?
body: <p>Hi i have one table "TABLE_OBJECTIVE" with 1 question and 4 option which i accept from<br>
  EditText. My question is that how to show this Question as parent and 4 option as child<br>
  in expandable list view. i use some code but it doesn't display question and display only<br>
  one option out of 4.<br>
  Here is my sample code.  </p>
  
  <pre><code>public class ObjectiveExamActivity extends ExpandableListActivity {
  
  @SuppressWarnings("unchecked")
  public void onCreate(Bundle savedInstanceState) {
      try{
           super.onCreate(savedInstanceState);
           setContentView(R.layout.displayobjectiveque);
           Intent intent=getIntent();
           setResult(RESULT_OK, intent);
  
      SimpleExpandableListAdapter expListAdapter =
          new SimpleExpandableListAdapter(
                  this,
                  createGroupList(),              
                  R.layout.group_row,             
                  new String[] { "Group Item" },  
                  new int[] { R.id.row_name },    
                  createChildList(),              
                  R.layout.child_row,             
                  new String[] {"Sub Item"},      
                  new int[] { R.id.grp_child}     
              );
          setListAdapter( expListAdapter );       
  
      }catch(Exception e){
          System.out.println("Errrr +++ " + e.getMessage());
      }
  }
  @SuppressWarnings("unchecked")
  private List createGroupList() {
        ArrayList result = new ArrayList();
      final MySQLiteHelper m=new MySQLiteHelper(getBaseContext());
      final ArrayList&lt;ObjectiveWiseQuestion&gt; LocWiseProfile= (ArrayList&lt;ObjectiveWiseQuestion&gt;) m.getAllObjectiveQuestion();       
  
      for (final ObjectiveWiseQuestion cn : LocWiseProfile)
      {       
          HashMap m1=new HashMap();
          m1.put("Question",cn.getQuestion());
          result.add(m1);         
      }
      return (List)result;
  }
  
  @SuppressWarnings("unchecked")
  private List createChildList()
  {
      final MySQLiteHelper m=new MySQLiteHelper(getBaseContext());
      final ArrayList&lt;ObjectiveWiseQuestion&gt; LocWiseProfile= (ArrayList&lt;ObjectiveWiseQuestion&gt;) m.getAllObjectiveQuestion();  
      ArrayList result = new ArrayList();
      for (final ObjectiveWiseQuestion cn : LocWiseProfile)
      { 
        /* each group need each HashMap-Here for each group we have 4 subgroups */
        ArrayList secList = new ArrayList(); 
        for(ObjectiveWiseQuestion cn1: LocWiseProfile)
        {
          HashMap child = new HashMap();
          //child.putAll(cn.getOptionA(),cn.getOptionB(),cn.getOptionC());
          child.put( "Sub Item", "Sub Item " + cn.getOptionA() );
          child.put("", cn.getOptionB());
          child.put("Option C", cn.getOptionC());
          child.put("Option D", cn.getOptionD());
          secList.add( child );
        }
       result.add( secList );
      }        
      return result;
  }
  </code></pre>
  
  <p>I really don't understand where the problem in my code.<br>
  Please give me some hint or reference.<br>
  Here is image of emulator which show only one item.<br>
  I have 4 option(Google,Samsung,Nokia,Onida).<br>
  Thanks in Advance.<br>
  <img src="https://i.stack.imgur.com/MbQGL.png" alt="enter image description here"></p>