Is it possible to update the content (e.g. a text) in a custom dialog when it is already shown? Or do I need to close and recreate it?
If yes, how can I do it?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes it is, the Progress Dialog does it for instance.
To do it with a custom dialog you will essentially need to have a updateHandler which you can invoke from some other part of your code, like a button or a thread, whatever. You’ll need to get and keep a reference to the textview you want to update. In your updateHandler just call setText on your textview to update it.
It should be quite straightforward. I don’t have any example code sorry, but you might be able to Google for some.