Android ExpandableListView
<p>Recently I'm trying to use android's expandable list view, so I googled around and stumbled upon this</p>

<p><a href="http://about-android.blogspot.com/2010/04/steps-to-implement-expandablelistview.html" rel="nofollow">http://about-android.blogspot.com/2010/04/steps-to-implement-expandablelistview.html</a></p>

<p>I followed the steps almost exactly, but I created a file just to contain implementation of my own adapter. Basically on my onCreate method of the main activity I call:</p>

<pre><code>mEntries = findViewById(R.id.entries);    
ExpandableListAdapter adapter = new MyExpandableListAdapter(this);
mEntries.setAdapter(adapter);
</code></pre>

<p>Here's the code (Taken from above URL and modified):</p>

<pre><code>import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;

public class MyExpandableListAdapter extends BaseExpandableListAdapter {
    private String[] groups = {"Vehicle", "Baj"};
    private String[][] children = {
        {"Mol", "Mor"},
        {"In", "Ruh"}
    };

    private Context cxt;

    public MyExpandableListAdapter(Context cxt) {
        this.cxt = cxt;
    }

    @Override
    public Object getChild(int groupPos, int childPos) {
        return children[groupPos][childPos];
    }

    @Override
    public long getChildId(int groupPos, int childPos) {
        return childPos;
    }

    @Override
    public View getChildView(int groupPos, int childPos,
            boolean isLastChild, View convertView, ViewGroup parent) {
        TextView tv = getGenericView();
        tv.setText(getChild(groupPos, childPos).toString());
        return tv;
    }

    @Override
    public int getChildrenCount(int groupPos) {
        return children[groupPos].length;
    }

    @Override
    public Object getGroup(int groupPos) {
        return groups[groupPos];
    }

    @Override
    public int getGroupCount() {
        return groups.length;
    }

    @Override
    public long getGroupId(int groupPos) {
        return groupPos;
    }

    public TextView getGenericView() {
        // Layout parameters for the ExpandableListView
        AbsListView.LayoutParams lp = new AbsListView.LayoutParams(
            ViewGroup.LayoutParams.FILL_PARENT, 64);

        TextView tv = new TextView(this.cxt);
tv.setLayoutParams(lp);

        // Center the text vertically
        tv.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
        // Set the text starting position
        tv.setPadding(36, 0, 0, 0);
        return tv;
    }

    @Override
    public View getGroupView(int groupPos, boolean isExpanded, View convertView,
            ViewGroup parent) {
        TextView tv = getGenericView();
        tv.setText(getGroup(groupPos).toString());
        return null;
    }

    @Override
    public boolean hasStableIds() {
        return true;
    }

    @Override
    public boolean isChildSelectable(int groupPos, int childPos) {
        return true;
    }

}
</code></pre>

<p>The logcat spit these:</p>

<pre><code>12-01 22:24:54.883: ERROR/AndroidRuntime(14424): java.lang.NullPointerException
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.AbsListView.obtainView(AbsListView.java:1276)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.ListView.makeAndAddView(ListView.java:1668)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.ListView.fillDown(ListView.java:637)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.ListView.fillFromTop(ListView.java:694)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.ListView.layoutChildren(ListView.java:1521)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.AbsListView.onLayout(AbsListView.java:1113)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.view.View.layout(View.java:6830)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.RelativeLayout.onLayout(RelativeLayout.java:900)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.view.View.layout(View.java:6830)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.view.View.layout(View.java:6830)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.view.View.layout(View.java:6830)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
12-01 22:24:54.883: ERROR/AndroidRuntime(14424):     at android.view.View.layout(View.java:6830)
snip...
</code></pre>

<p>Anyone care to shed a light on this? =/</p>

<p>EDIT: 
I've already implemented the methods required in the Base class.</p>

<p>EDIT2:
Code added</p>
