Android customized row in listview can't recieve onItemClick
<p>because I need to display something more than just a list in a Fragment.
So I choose Fragment rather than ListFragment, and my layout is something looks like</p>

<pre><code>&lt;linearlayout...&gt;
    &lt;TextView...&gt;...&lt;TextView/&gt;
    &lt;Button...&gt;...&lt;Button/&gt;
    &lt;ListView android:id = "@"+id/mylist" ...&gt;&lt;/ListView&gt;
&lt;/linearylayout&gt;
</code></pre>

<p>And I implemnt "MyAdapter" extend BaseAdapter, which has getView like following</p>

<pre><code>@Override
public View getView(int position, View convertView, ViewGroup parent) 
{
    if(position == 0)
    {
        return categroyView("Team leader");
    }
    else if (position == 2)
    {
        return categroyView("Team memebers");
    }
    else
    {
        LayoutInflater inflater = context.getLayoutInflater();
        View v = inflater.inflate(R.layout.row_group, null, false);
        return v;
    }
}


protected View categroyView(String text)
{
    TextView txtView = new TextView(context);
    txtView.setText(text);
    return txtView;
}
</code></pre>

<p>It turns out that I can receive onItemClick when its position is 0 or 2 (which as you can see I dynamically generate textView.
Meanwhile <strong>I can't receive onItemClick</strong> when its position is not 0 or 2 (which I return inflate view from XML)</p>

<p>I've seen some discussion about if customized row layout has some clickable item (like button), this situation will happen, but even my row layout has only one textView, it still failed to receive onItemClick.</p>

<p>p.s.</p>

<ol>
<li>Also, I select Fragment rather than Activity for other other design issue.</li>
<li>I know I can alternatively add v.setOnClickListene in getView to help this issue, but then still the item won't highlight if I pressed on it.</li>
</ol>
