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. HTTP Client........SocketException

I'm working behind proxy, whenever i send a req using HTTPclient i
get a SocketException........Does anybody knows how to solve this
problem...........
--~--~---------~--~----~------------~-------~--~----~

2. layout editor orientation dropdown.

I would like my application to remain in protrait which i have
achieved by setting the orientation to portrait in the manifest. Is
there a way to ensure that one of my layouts(just one) is only
displayed in landscape mode?
I tried selecting portrait in the orientation dropdown (in the layout
editor) but that didnt seem to do anything. just showed an orange
triangle by the dropdown box.
--~--~---------~--~----~------------~-------~--~----~

3. Is it possible to create an "activity" instance using constructor like a common Java class?

4. Learn Android

5. Getting contact name from contact number from phonebook.

6. for transferring file, is it require any permissions?

7. How to disable Auto-Focus on Camera?