Not getting the value of the item I clicked
<p>I'm trying to retrieve the name of the chapters that I clicked but while debugging it is showing the at the values of the string "selected" is "com.tutorial.expandListView.Classes.ExpandListChild@44f49728" in the setOnChildClick method. Please give some suggestions about it or the place I made the error.</p>

<p>MainAcivity.java</p>

<pre><code>public class MainActivity extends Activity {



    /** Called when the activity is first created. */
    private ExpandListAdapter ExpAdapter;
    private ArrayList&lt;ExpandListGroup&gt; ExpListItems;
    private ExpandableListView ExpandList;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ExpandList = (ExpandableListView) findViewById(R.id.ExpList);
        ExpListItems = SetStandardGroups();
        ExpAdapter = new ExpandListAdapter(MainActivity.this, ExpListItems);
        ExpandList.setAdapter(ExpAdapter);
        ExpandList.setOnChildClickListener(new OnChildClickListener() {


            public boolean onChildClick(ExpandableListView parent, View v,
                    int groupPosition, int childPosition, long id) {
                // TODO Auto-generated method stub

                String selected= ExpAdapter.getChild(groupPosition, childPosition).toString();
                System.out.print(selected);
                return false;
            }
        });
    }

    public ArrayList&lt;ExpandListGroup&gt; SetStandardGroups() {
        ArrayList&lt;ExpandListGroup&gt; list = new ArrayList&lt;ExpandListGroup&gt;();
        ArrayList&lt;ExpandListChild&gt; list2 = new ArrayList&lt;ExpandListChild&gt;();
        ExpandListGroup gru1 = new ExpandListGroup();
        gru1.setName("Unit1");
        ExpandListChild ch1_1 = new ExpandListChild();
        ch1_1.setName("chapter11");
        ch1_1.setTag(null);
        list2.add(ch1_1);
        ExpandListChild ch1_2 = new ExpandListChild();
        ch1_2.setName("chapter12");
        ch1_2.setTag(null);
        list2.add(ch1_2);
        ExpandListChild ch1_3 = new ExpandListChild();
        ch1_3.setName("chapter13");
        ch1_3.setTag(null);
        list2.add(ch1_3);
        gru1.setItems(list2);
        list2 = new ArrayList&lt;ExpandListChild&gt;();

        ExpandListGroup gru2 = new ExpandListGroup();
        gru2.setName("Unit2");
        ExpandListChild ch2_1 = new ExpandListChild();
        ch2_1.setName("chapter21");
        ch2_1.setTag(null);
        list2.add(ch2_1);
        ExpandListChild ch2_2 = new ExpandListChild();
        ch2_2.setName("chapter22");
        ch2_2.setTag(null);
        list2.add(ch2_2);
        ExpandListChild ch2_3 = new ExpandListChild();
        ch2_3.setName("chapter23");
        ch2_3.setTag(null);
        list2.add(ch2_3);
        gru2.setItems(list2);
        list.add(gru1);
        list.add(gru2);

        return list;
    }
}
</code></pre>

<p>ExpandListAdapter.java</p>

<pre><code>public class ExpandListAdapter extends BaseExpandableListAdapter {

    private Context context;
    private ArrayList&lt;ExpandListGroup&gt; groups;
    public ExpandListAdapter(Context context, ArrayList&lt;ExpandListGroup&gt; groups) {
        this.context = context;
        this.groups = groups;
    }

    public void addItem(ExpandListChild item, ExpandListGroup group) {
        if (!groups.contains(group)) {
            groups.add(group);
        }
        int index = groups.indexOf(group);
        ArrayList&lt;ExpandListChild&gt; ch = groups.get(index).getItems();
        ch.add(item);
        groups.get(index).setItems(ch);
    }
    public Object getChild(int groupPosition, int childPosition) {
        // TODO Auto-generated method stub
        ArrayList&lt;ExpandListChild&gt; chList = groups.get(groupPosition).getItems();
        return chList.get(childPosition);
    }

    public long getChildId(int groupPosition, int childPosition) {
        // TODO Auto-generated method stub
        return childPosition;
    }

    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View view,
            ViewGroup parent) {
        ExpandListChild child = (ExpandListChild) getChild(groupPosition, childPosition);
        if (view == null) {
            LayoutInflater infalInflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
            view = infalInflater.inflate(R.layout.expandlist_child_item, null);
        }
        TextView tv = (TextView) view.findViewById(R.id.tvChild);
        tv.setText(child.getName().toString());
        tv.setTag(child.getTag());
        // TODO Auto-generated method stub
        return view;
    }

    public int getChildrenCount(int groupPosition) {
        // TODO Auto-generated method stub
        ArrayList&lt;ExpandListChild&gt; chList = groups.get(groupPosition).getItems();

        return chList.size();

    }

    public Object getGroup(int groupPosition) {
        // TODO Auto-generated method stub
        return groups.get(groupPosition);
    }

    public int getGroupCount() {
        // TODO Auto-generated method stub
        return groups.size();
    }

    public long getGroupId(int groupPosition) {
        // TODO Auto-generated method stub
        return groupPosition;
    }

    public View getGroupView(int groupPosition, boolean isLastChild, View view,
            ViewGroup parent) {
        ExpandListGroup group = (ExpandListGroup) getGroup(groupPosition);
        if (view == null) {
            LayoutInflater inf = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
            view = inf.inflate(R.layout.expandlist_group_item, null);
        }
        TextView tv = (TextView) view.findViewById(R.id.tvGroup);
        tv.setText(group.getName());
        // TODO Auto-generated method stub
        return view;
    }

    public boolean hasStableIds() {
        // TODO Auto-generated method stub
        return true;
    }

    public boolean isChildSelectable(int arg0, int arg1) {
        // TODO Auto-generated method stub
        return true;
    }
}
</code></pre>

<p>ExpandListChild.java</p>

<pre><code>public class ExpandListChild {

    private String Name;
    private String Tag;

    public String getName() {
        return Name;
    }
    public void setName(String Name) {
        this.Name = Name;
    }
    public String getTag() {
        return Tag;
    }
    public void setTag(String Tag) {
        this.Tag = Tag;
    }
}
</code></pre>

<p>ExpandListGroup.java</p>

<pre><code>import java.util.ArrayList;

public class ExpandListGroup {

    private String Name;
    private ArrayList&lt;ExpandListChild&gt; Items;

    public String getName() {
        return Name;
    }
    public void setName(String name) {
        this.Name = name;
    }
    public ArrayList&lt;ExpandListChild&gt; getItems() {
        return Items;
    }
    public void setItems(ArrayList&lt;ExpandListChild&gt; Items) {
        this.Items = Items;
    }
}
</code></pre>
