title: How to implement onchildclick listener in this example?
body: <p>So i am having an expandable listview. What i want is to make clickable each children. if I press the first one I want to open the class1, if I press the second one I want to open the class2, if I press the third one I want to open the class3 and so on... I am new in programming so please explain me like you would do it for a dummie.</p>
  
  <p>This is my Activity</p>
  
  <pre><code>public class Mecanica  extends ExpandableListActivity implements OnChildClickListener {
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          ExpandableListView expandbleLis = getExpandableListView();
          expandbleLis.setDividerHeight(2);
          expandbleLis.setGroupIndicator(null);
          expandbleLis.setClickable(true);
  
          setGroupData();
          setChildGroupData();
  
          NewAdapter mNewAdapter = new NewAdapter(groupItem, childItem);
          mNewAdapter.setInflater((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE), this);
          getExpandableListView().setAdapter(mNewAdapter);
          expandbleLis.setOnChildClickListener(this);
      }
  
      public void setGroupData() {
          groupItem.add("Directia");
          groupItem.add("Franarea");
          groupItem.add("Motorul");
          groupItem.add("Rotile");
          groupItem.add("Siguranta si control");
          groupItem.add("Suspensia");
          groupItem.add("Transmisia");
      }
  
      ArrayList&lt;String&gt; groupItem = new ArrayList&lt;String&gt;();
      ArrayList&lt;Object&gt; childItem = new ArrayList&lt;Object&gt;();
  
      public void setChildGroupData() {
          /**
           * Add Data For TecthNology
           */
          ArrayList&lt;String&gt; child = new ArrayList&lt;String&gt;();
          child.add("Java");
          child.add("Drupal");
          child.add(".Net Framework");
          child.add("PHP");
          childItem.add(child);
  
          /**
           * Add Data For Mobile
           */
          child = new ArrayList&lt;String&gt;();
          child.add("Android");
          child.add("Window Mobile");
          child.add("iPHone");
          child.add("Blackberry");
          childItem.add(child);
          /**
           * Add Data For Manufacture
           */
          child = new ArrayList&lt;String&gt;();
          child.add("HTC");
          child.add("Apple");
          child.add("Samsung");
          child.add("Nokia");
          childItem.add(child);
          /**
           * Add Data For Extras
           */
          child = new ArrayList&lt;String&gt;();
          child.add("Contact Us");
          child.add("About Us");
          child.add("Location");
          child.add("Root Cause");
          childItem.add(child);
      }    
  }
  </code></pre>
  
  <p>And the adapter class</p>
  
  <pre><code>@SuppressWarnings("unchecked")
  public class NewAdapter extends BaseExpandableListAdapter {
  
      public ArrayList&lt;String&gt; groupItem, tempChild;
      public ArrayList&lt;Object&gt; Childtem = new ArrayList&lt;Object&gt;();
      public LayoutInflater minflater;
      public Activity activity;
  
      public NewAdapter(ArrayList&lt;String&gt; grList, ArrayList&lt;Object&gt; childItem) {
          groupItem = grList;
          this.Childtem = childItem;
      }
  
      public void setInflater(LayoutInflater mInflater, Activity act) {
          this.minflater = mInflater;
          activity = act;
      }
  
      @Override
      public Object getChild(int groupPosition, int childPosition) {
          return null;
      }
  
      @Override
      public long getChildId(int groupPosition, int childPosition) {
          return 0;
      }
  
      @Override
      public View getChildView(int groupPosition, final int childPosition,
              boolean isLastChild, View convertView, ViewGroup parent) {
          tempChild = (ArrayList&lt;String&gt;) Childtem.get(groupPosition);
          TextView text = null;
          if (convertView == null) {
              convertView = minflater.inflate(R.layout.childrow, null);
          }
          text = (TextView) convertView.findViewById(R.id.textView1);
          text.setText(tempChild.get(childPosition));
          /*convertView.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
                  Toast.makeText(activity, tempChild.get(childPosition),
                          Toast.LENGTH_SHORT).show();
              }
          });*/
          return convertView;
      }
  
      @Override
      public int getChildrenCount(int groupPosition) {
          return ((ArrayList&lt;String&gt;) Childtem.get(groupPosition)).size();
      }
  
      @Override
      public Object getGroup(int groupPosition) {
          return null;
      }
  
      @Override
      public int getGroupCount() {
          return groupItem.size();
      }
  
      @Override
      public void onGroupCollapsed(int groupPosition) {
          super.onGroupCollapsed(groupPosition);
      }
  
      @Override
      public void onGroupExpanded(int groupPosition) {
          super.onGroupExpanded(groupPosition);
      }
  
      @Override
      public long getGroupId(int groupPosition) {
          return 0;
      }
  
      @Override
      public View getGroupView(int groupPosition, boolean isExpanded,
              View convertView, ViewGroup parent) {
          if (convertView == null) {
              convertView = minflater.inflate(R.layout.grouprow, null);
          }
          ((CheckedTextView) convertView).setText(groupItem.get(groupPosition));
          //((CheckedTextView) convertView).setChecked(isExpanded);
          return convertView;
      }
  
      @Override
      public boolean hasStableIds() {
          return false;
      }
  
      @Override
      public boolean isChildSelectable(int groupPosition, int childPosition) {
          return true;
      }
  }
  </code></pre>