I would like to open a custom dialog when someone clicks on a listview entry. That dialog will need to know the text that was clicked on in order to display additional information on that particular entry. Can anyone point me in the right direction on how to accomplish that?
Thanks!
I would like to open a custom dialog when someone clicks on a listview
Share
On the
ListActivity, override theonListItemClickmethod. There, you will get the position of the item that was clicked. As you said you want to know the text that is on the item that was clicked, I suppose you have a simple List. In that case, I guess you have, for instance, an array with strings to populate the list.So, in this case I’m supposing you have an array of
Strings calleditems. The next step would be to create aDialog, which can be done this way:By the way… if you want to receive nice answers here, make sure you provide nice questions. By “nice question” I mean something with a little bit of your code, so that we can get a better idea of how to help you 😉