views:

39

answers:

1

hello guys,

i have a image view and on top of it i have a button. now what i want is when i click on the button i should get a list of images on same Activity.actually i am trying to make a list in button,s onClick event. event gets fired but it does not show the list. anybody can have any idea how shall i achieve this i am also making my layout programmatically.

thanks alot

A: 

Without seeing some code it's hard to give a definite answer, but these are a few possibilities.

Create the listview together with the button, but set it's visibility to View.GONE or View.INVISIBLE. In the button's onClick method, set it to View.VISIBLE.

Alternatively, do the listview creation in the button's onClick (which I gather is what you're doing?), making sure you don't forget to add it to your layout. I have no idea why this does not work for you. Show some code or use the debugger to step through it and find out where it goes wrong.

benvd