One adapter for different adapter views - how to specify proper layout for the view?

by (Mishail) » Wed, 04 Mar 2009 23:50:13 GMT


Sponsored Links
 Greetings,

I want to re-use 1 adapter (similar to well known ImageAdapter from
samples) with 2 different views - Gallery and GridView.

I need to specify LayoutParams for the each View returned by getView()
method of my adapter. In case of Gallery it should be instance of
Gallery.LayoutParams, and in case of GridView it should be
GridView.LayoutParams. I'll get an exception for sure if I'll try
Gallery.LayoutParams with GridView and vice versa.

What is the best way to do that? Can I somehow use "parent" parameter
(ViewGroup parent) for that?

--~--~---------~--~----~------------~-------~--~----~



One adapter for different adapter views - how to specify proper layout for the view?

by (Mishail) » Thu, 05 Mar 2009 20:59:07 GMT


 Up thread.

I believe it should be trivial. Just stick my nose into the
appropriate docs
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Regarding Image View

Hi All,
I have a query i want to set my ImageView over the Gallery,How to do this?
One more thing is there any possibility to display images in android app
without using Gallery view.

Thanks and regards,
Jitesh

-- 

2. Custom Scroll bar

Hi,


                      Is there any chance of making Scroll bar like this by
using existing android's Scroll view s .









Thanks,
sagar

-- 

3. Cross-Compiling bash for Android using toolchain - compile errors. Please help.

4. Streaming buffer problem

5. multicast working on some routers, not others

6. Implement clock widget using pictures as numbers, and getting user location

7. Problem setting focus