How can I dynamically add item to a Gallery in android

by ying lcs » Thu, 05 Mar 2009 09:03:11 GMT

Sponsored Links

Can you please tell me how can I dynamically add item to Gallery?
I have looked at ApiDemo and have studied their example.

But the ImageAdapter there is a BaseAdapter which has a fixed sized
array and the getCount() just return the length of the array.
My question is how can I change that to a dynamically size vector? I
have set breakpoints in getCount(), and it only called once
dynamically during initialization.  So how can I tell android that the
gallery size has changed?

Thank you.


Other Threads

1. Maps not working in the android emulator

Hi all,

I am trying the Google maps API example, but when I run the code emulator
gives the error "The Application has stopped unexpectedly". I have put down
the Logcat details below and also attached the screenshot of the error.



2. noob question I guess - input requires enter key

Hi all,

so I just started meddling with android and have started putting
together an app. I used edit text boxed for input but when I run my
app and try to input text in my field (in emulator) a keyboard pops up
and no matter what I type it does not appear in the edit text box
until I press Enter key? Is this normal behavior or is there a way to
make letters appear as I type them?

Second thing I notice is that when I type it suggests Chinese
characters, so I guess I might need to change the keyboard input
perhaps? I checked what coding I use and it is UTF-8.

So, can anyone help me with this, what should I do to get character
appear as I type in edit box.



3. Simple Search App -- Help Required

4. Controlling Android init process / staged boot

5. (Newbie warning) Adding one of the sample projects to Eclipse

6. System signing a test suite

7. Preventing Multiple AppWidget Instances