Here is the code of my getview on button click where i am trying to add
relative layout but nothing happing
Holder holder;
if (convertView == null) {
convertView =
inflater.inflate(R.layout.grid_image_row, null);
holder = new Holder();
holder.iv_product_image = (ImageView)
convertView.findViewById(R.id.id_iv_product_image) ;
RelativeLayout.LayoutParams iv_product_image_params
= new RelativeLayout.LayoutParams(imageWidth,imageHeight) ;
holder.iv_product_image.setLayoutParams(iv_product_image_params) ;
holder.bt_expand_save_overlay = (Button)
convertView.findViewById(R.id.id_bt_expand_save_overlay) ;
convertView.setTag(holder);
} else {
holder = (Holder) convertView.getTag();
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
int selectedImage = (Integer) v.getTag() ;
ViewGroup gridChild = (ViewGroup)
mAdapter.getView(selectedImage, null, gvSeach) ;
RelativeLayout saveForLaterOverlay = new
RelativeLayout(ProductListActivity.this) ;
RelativeLayout.LayoutParams
saveForLaterOverlayParams = new RelativeLayout.LayoutParams(100,100);
saveForLaterOverlay.setLayoutParams(saveForLaterOverlayParams) ;
gridChild.addView(saveForLaterOverlay) ;
TextView tv=new
TextView(ProductListActivity.this);
tv.setTextSize(15);
tv.setText("Hello");
saveForLaterOverlay.addView(tv) ;
}
}) ;
i am trying to add saveForLaterOverlay on button pressed number item in
grid view but nothing happing this method just executing when i click the
button on image but doing nothing.
thanks
On Wed, Dec 11, 2013 at 11:49 PM, Justin Anderson <[email protected]>wrote:
> GridView uses an adapter... all of the changes you are talking about doing
> should be done in your adapter's getView() method.
>
> Thanks,
> Justin Anderson
> MagouyaWare Developer
> http://sites.google.com/site/magouyaware
>
>
> On Wed, Dec 11, 2013 at 10:09 AM, TreKing <[email protected]> wrote:
>
>>
>> On Tue, Dec 10, 2013 at 11:50 PM, Amit Mangal <
>> [email protected]> wrote:
>>
>>> i get position of button pressed using get tag but i am unable to get
>>> the relative layout on whihc image and button is displaying.
>>>
>>> any idea how to get that layout view
>>
>>
>> Your question is not really clear. What does your hierarchy look like?
>>
>>
>> -------------------------------------------------------------------------------------------------
>> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
>> transit tracking app for Android-powered devices
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Android Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.