title: Expandablelistview in fragment- Expandable List Not display
body: <p>im trying to implement Expandable list View in Fragements.i have tested all the values set to toast and it work fine.But My expandable list view not Dispaly.I didnt get any Error.please find below the code i used.</p>
  
  <pre><code>   package com.test.expandablelistView;
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  import com.example.tesfragement.R;
  import com.example.tesfragement.R.layout;
  import android.os.Bundle;
  import android.app.Fragment;
  import android.database.DataSetObserver;
  import android.support.v4.app.FragmentActivity;
  import android.view.Gravity;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ExpandableListAdapter;
  import android.widget.ExpandableListView;
  import android.widget.SimpleExpandableListAdapter;
  import android.widget.Toast;
  
  /**
   * A simple {@link android.support.v4.app.Fragment} subclass.
   * 
   */
  
  public class ExpandableListFragment extends Fragment {
  
      View v;
       ExpandableListAdapter mAdapter;
      List&lt;String&gt; _listDataHeader;
      HashMap&lt;String, List&lt;String&gt;&gt; _listDataChild;
      private Parent parent;
      private Child child;
      ExpandableListView lv;
  
  
  
  
      public ExpandableListFragment() {
          // Required empty public constructor
  
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          v= inflater.inflate(R.layout.expandable_fragements,
                  container, false);
  
  
          return v;
      }
  
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
  
          super.onActivityCreated(savedInstanceState);
          parent=new Parent();
          child=new Child();
           ExpandableListView lv = (ExpandableListView) v.findViewById(R.id.expandableListView1);
  
           //here setting all the values to Parent and child classes
           setDataValues();
           prepareListData();//here get the values and set this values to adoptor and set it visible
  
  
           mAdapter=new ExpandableListAdapter() {
  
              @Override
              public void unregisterDataSetObserver(DataSetObserver observer) {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello", Toast.LENGTH_LONG).show();
  
              }
  
              @Override
              public void registerDataSetObserver(DataSetObserver observer) {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello1", Toast.LENGTH_LONG).show();
              }
  
              @Override
              public void onGroupExpanded(int groupPosition) {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello2", Toast.LENGTH_LONG).show();
              }
  
              @Override
              public void onGroupCollapsed(int groupPosition) {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello3", Toast.LENGTH_LONG).show();
              }
  
              @Override
              public boolean isEmpty() {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello4", Toast.LENGTH_LONG).show();
                  return false;
              }
  
              @Override
              public boolean isChildSelectable(int groupPosition, int childPosition) {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello5", Toast.LENGTH_LONG).show();
                  return false;
              }
  
              @Override
              public boolean hasStableIds() {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello6", Toast.LENGTH_LONG).show();
                  return false;
              }
  
              @Override
              public View getGroupView(int groupPosition, boolean isExpanded,
                      View convertView, ViewGroup parent) {
                  Toast.makeText(getActivity(),"hello7", Toast.LENGTH_LONG).show();
                  // TODO Auto-generated method stub
                  return v;
              }
  
              @Override
              public long getGroupId(int groupPosition) {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello8", Toast.LENGTH_LONG).show();
                  return 0;
              }
  
              @Override
              public int getGroupCount() {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello9", Toast.LENGTH_LONG).show();
                  return 0;
              }
  
              @Override
              public Object getGroup(int groupPosition) {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello10", Toast.LENGTH_LONG).show();
                  return null;
              }
  
              @Override
              public long getCombinedGroupId(long groupId) {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello11", Toast.LENGTH_LONG).show();
                  return 0;
              }
  
              @Override
              public long getCombinedChildId(long groupId, long childId) {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello12", Toast.LENGTH_LONG).show();
                  return 0;
              }
  
              @Override
              public int getChildrenCount(int groupPosition) {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello13", Toast.LENGTH_LONG).show();
                  return 0;
              }
  
              @Override
              public View getChildView(int groupPosition, int childPosition,
                      boolean isLastChild, View convertView, ViewGroup parent) {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello14", Toast.LENGTH_LONG).show();
                  return v;
              }
  
              @Override
              public long getChildId(int groupPosition, int childPosition) {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello15", Toast.LENGTH_LONG).show();
                  return 0;
              }
  
              @Override
              public Object getChild(int groupPosition, int childPosition) {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello16", Toast.LENGTH_LONG).show();
                  return null;
              }
  
              @Override
              public boolean areAllItemsEnabled() {
                  // TODO Auto-generated method stub
                  Toast.makeText(getActivity(),"hello17", Toast.LENGTH_LONG).show();
                  return false;
              }
          };
  
             // mAdapter = new ExpandableListAdapter(this, _listDataHeader, _listDataChild);
  
              // setting list adapter
              lv.setAdapter(mAdapter);
  
  
  
      }
  
  
      public void prepareListData()
      {
          // testing purpose
          _listDataHeader = new ArrayList&lt;String&gt;();
          _listDataChild = new HashMap&lt;String, List&lt;String&gt;&gt;();
  
  
          // declare the references
          //add the parent values to List
          _listDataHeader.add(parent.getCardName());
          _listDataHeader.add(String.valueOf(parent.getMinimum_salary()));
          _listDataHeader.add(String.valueOf(parent.getInterest_rate()));
  
  
          //set Child views to parent
          List&lt;String&gt; cardDetails=new ArrayList&lt;String&gt;();
          cardDetails.add("");
  
          List&lt;String&gt; mininum_sal_details=new ArrayList&lt;String&gt;();
          mininum_sal_details.add(child.GetMinimumSalDetails());
  
          List&lt;String&gt; interest_details=new ArrayList&lt;String&gt;();
          interest_details.add(child.get_interest_rate_details());
  
          //set to adoptor
  
          _listDataChild.put(_listDataHeader.get(0),  cardDetails);
          _listDataChild.put(_listDataHeader.get(1),mininum_sal_details);
  
          //
  
           for(int i = 0; i &lt; _listDataHeader.size(); i++) //cars name of arraylist
              {
                 String value=_listDataHeader.get(i);  
                 Toast toast = Toast.makeText(getActivity(),value, Toast.LENGTH_LONG);
                 toast.setGravity(Gravity.CENTER, 0, 0);
                 toast.show();
  
              }
  
  
  
      }
  
      public void setDataValues()
      {
          //set Parent values
          parent.setCardName("Platinum credit Card");
          parent.setMinimum_salary(15000.00);
          parent.setInterest_Rate(1.2);
  
          //set Child values
          child.set_card_details("You require minimum salary of 1500 per month");
          child.set_interest_rate_details("interest rate is 2.0%");
  
  
      }
  
  
  }
  </code></pre>