Note that there are some explanatory texts on larger screens.

plurals
  1. POgridview stop selecting when adding button on its layout
    text
    copied!<p>below is my gridview layout which work fine without button when i add buttonon its layout its stop selecting clickany image in gridview nothing effect why/?? is there any restriction for gridview to not adding button on its layout??? this is my screen shot imgur.com/jvGzpRP</p> <pre><code> I'm changing from this: &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;ImageView android:id="@+id/image2" android:layout_width="wrap_content" android:layout_height="70dp" android:layout_marginLeft="5dp" android:layout_marginRight="5dp" android:padding="5dp" android:scaleType="fitXY" android:src="@drawable/ic_launcher" /&gt; &lt;TextView android:id="@+id/title2" android:layout_width="90dp" android:layout_height="wrap_content" android:gravity="center_horizontal" android:paddingTop="10dp" android:textColor="#000" /&gt; &lt;/LinearLayout&gt; To this: &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:orientation="horizontal" &gt; &lt;ImageView android:id="@+id/image2" android:layout_width="fill_parent" android:layout_height="150dp" android:layout_weight="1" android:gravity="center_horizontal" android:scaleType="fitXY" android:src="@drawable/ic_launcher" /&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="2" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/title2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="2" android:gravity="center_vertical" android:textColor="#000000" /&gt; &lt;TextView android:id="@+id/title3" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center_vertical" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="0.5" android:orientation="vertical" &gt; &lt;Button android:id="@+id/ButtonSendFeedback" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/roundshapebtn" android:text="Order Now" android:textColor="#ffffff" android:textSize="15pt" /&gt; &lt;/LinearLayout&gt; gridview = (GridView) findViewById(R.id.gridview3); cla = new CategoryListAdapter5(ProductList.this); gridview.setAdapter(cla); public class CategoryListAdapter5 extends BaseAdapter { private Activity activity; private AQuery androidAQuery; public CategoryListAdapter5(Activity act) { this.activity = act; // imageLoader = new ImageLoader(act); } public int getCount() { // TODO Auto-generated method stub return ProductList.Category_ID.size(); } public Object getItem(int position) { // TODO Auto-generated method stub return position; } public long getItemId(int position) { // TODO Auto-generated method stub return position; } public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub ViewHolder holder; androidAQuery = new AQuery(getcontext()); if(convertView == null){ LayoutInflater inflater = (LayoutInflater) activity .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.viewitem3, null); holder = new ViewHolder(); convertView.setTag(holder); }else{ holder = (ViewHolder) convertView.getTag(); } holder.txtText = (TextView) convertView.findViewById(R.id.title2); holder.txtText3 = (TextView) convertView.findViewById(R.id.title3); holder.imgThumb = (ImageView) convertView.findViewById(R.id.image2); // holder.txtText.setText(ProductList.Category_name.get(position)); holder.txtText.setText(Html.fromHtml(ProductList.Category_name.get(position))); holder.txtText3.setText(Html.fromHtml(ProductList.Category_price.get(position))); androidAQuery.id(holder.imgThumb).image(ProductList.Category_image.get(position), true, true); return convertView; } private Activity getcontext() { // TODO Auto-generated method stub return null; } static class ViewHolder { TextView txtText; TextView txtText3; ImageView imgThumb; } } </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