Hi I have a alertdialog that is create when you click on an item in a listview, Im trying to get the name of the file,description, author etc.. from my activity and display it in my alertdialog but .setText will not work, can someone please help. Thank you, here is my code: http://pastebin.com/FzWSPp5e
Share
this is not at all how you properly use dialogs in Android. you need to define your dialogs in an override of onCreateDialog, as described in the documentation:
following this guide, you should be able to fix your problem. here’s an example i just copied and pasted from a random app:
with the above code, you can call showDialog(DIALOG_BLOCK_SIZE) to show the dialog. also note that dialogs are created once and shown over and over again. to force rebuilding a dialog, call removeDialog(int) before calling showDialog(int). overriding onPrepareDialog() is the best method, but using removeDialog works and it’s easier.