Click Event on ImageButton not dispatched immediately
<p>I'm having a weird problem, in my rather complex view layout. (I will try to simplify it a bit  in my explanation)</p>

<p>Basically I have a <code>ListView</code>, where each item consists of a <code>TextView</code> and an <code>ImageButton</code>. I am able to either click the list item (on the textview), or the button (I set the ImageButton to non-focusable, otherwise it wouldn't work)</p>

<p>Now it seems to work fine, <strong>until I open another window</strong> and return to the listview.
From that point on, I can click the ImageButton without anything happening (not even the background changes during the click). But when I click on the TextView again, all the click events from the ImageButton are dispatched at once.</p>

<p>Why is that?</p>

<p>EDIT:</p>

<p>The List Item:</p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="0px"
    android:minHeight="40dp"
    android:orientation="horizontal"
    android:paddingLeft="2px"
    android:paddingRight="2px"
    &gt;

    &lt;TextView
        android:id="@+id/text1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="Text"
        android:textSize="19dp"
        android:paddingTop="4px"
        android:paddingBottom="4px"
        android:layout_gravity="center_vertical"/&gt;

    &lt;LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/open_subtree_layout"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_margin="0px"
        android:orientation="horizontal"
        android:padding="0px"&gt;

        &lt;View
            android:layout_width="1px"
            android:layout_height="match_parent"
            android:background="@drawable/separator_line" /&gt;

        &lt;com.treeviewer.leveldisplay.DontPressWithParentImageButton
            android:id="@+id/btn_right"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="center_vertical"
            android:background="@drawable/list_selector_background"
            android:focusable="false"
            android:focusableInTouchMode="false"
            android:padding="10dp"
            android:src="@drawable/arrow_right" /&gt;
    &lt;/LinearLayout&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>That's how it is inflated:</p>

<pre><code>    [...]
LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mView = inflater.inflate(R.layout.tree_row, null, false);

TextView textView = (TextView)mView.findViewById(R.id.text1);
LinearLayout nextNodeButtonContainer = (LinearLayout)mView.findViewById(R.id.open_subtree_layout);

if(childCount &gt;= 0) {
    titleBuilder.append(" (" + childCount + ")");
    nextNodeButtonContainer.setVisibility(View.VISIBLE);
    View button = nextNodeButtonContainer.findViewById(R.id.btn_right);
    button.setFocusable(false);
    button.setFocusableInTouchMode(false);
    //button.setClickable(true);
    button.setOnClickListener(clickListener);

    button.setTag(tagValue);
} else {
    nextNodeButtonContainer.setVisibility(View.GONE);
}

textView.setText(titleBuilder);
</code></pre>

<p>Let me know, if you need more code.</p>
