Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You use checkbox in customview_completedxml_listview.xml that is why onItemClick listener is not working. If you set clickable = "false" in checkbox then onItemclick listener will work.</p> <p>If you want want that checkbox will stil work then you have to set onclicklistener event in you custom adapter class.</p> <p>// I edit getView</p> <pre><code> @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = LayoutInflater.from(ob) ; View v = inflater.inflate(R.layout.customview_completedxml_listview, null ) ; TextView txt = ( TextView ) v.findViewById(R.id.txt_fordisplayingdata) ; txt.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { Toast.makeText(ob, "Hello", Toast.LENGTH_SHORT).show(); } }); txt.setText(recieved_Array[position]) ; return v ; } </code></pre> <p>/////////////////////// // Second solution set android:focusable="false" in checkbox</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="50dp" android:orientation="horizontal" &gt; &lt;TextView android:id="@+id/txt_fordisplayingdata" android:layout_width="240dp" android:text="display data" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="10dp" /&gt; &lt;TextView android:id="@+id/txt_fordisplayingLargerdata" android:layout_width="240dp" android:text="display data larger bahut larger " android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="10dp" android:visibility="gone" /&gt; &lt;View android:layout_width="2dp" android:layout_toRightOf="@id/txt_fordisplayingdata" android:layout_height="15dp" android:layout_marginLeft="15dp" android:layout_centerVertical="true" android:id="@+id/view_forcompletedtask" /&gt; &lt;CheckBox android:layout_toRightOf="@id/view_forcompletedtask" android:id="@+id/checkbox_tocomplete" android:layout_marginLeft="15dp" android:layout_width="wrap_content" android:focusable="false" android:layout_height="wrap_content" android:layout_centerVertical="true" /&gt; &lt;/RelativeLayout&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload