That should work.

Media media = medias.get(index);
        if (convertView == null) {
            LayoutInflater inflater = (LayoutInflater) context
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = inflater.inflate(R.layout.media_adapter, null,
true);
        }
        ImageView img = (ImageView)
convertView.findViewById(R.id.mediaImage);
        img.setImageBitmap(media.getBmp());
        img.setLayoutParams(new LayoutParams(53, 53));

Something like this. I am not sure why isn't it working. Maybe, it is being
diaplyed, but you have to adjust the layout a bit.

On Wed, Oct 6, 2010 at 6:31 PM, kavitha b <[email protected]> wrote:

> yes,I tried that using inflater.
>
> But it is not working.No views are shown in gallery then.
>
> Any example with that?
>
>
> On Wed, Oct 6, 2010 at 6:23 PM, Kumar Bibek <[email protected]> wrote:
>
>> Sure, create a custom view, and use that, else, you can create the custom
>> view in the getView method of the adapter.
>>
>> On Wed, Oct 6, 2010 at 6:21 PM, kavitha b <[email protected]> wrote:
>>
>>> Hi All,
>>>
>>> As i see in Gallery example in APIDemos,it is possible to add Image
>>> listView or textviews as Gallery items.
>>>
>>> But my requirement is,I need to add both textview and Image combined as a
>>> single item in Gallery.
>>>
>>> All examples are showing either imageview adapter or text view adapter as
>>> Gallery items.
>>>
>>> But I want to add Custom View as Gallery Item.
>>>
>>> Any way to do this?
>>>
>>> Please help.
>>>
>>> Thanks
>>> kavitha
>>>
>>> --
>>> 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]<android-developers%[email protected]>
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-developers?hl=en
>>
>>
>>
>>
>> --
>> Kumar Bibek
>> http://techdroid.kbeanie.com
>> http://www.kbeanie.com
>>
>>  --
>> 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]<android-developers%[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 post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com

-- 
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

Reply via email to