刷新或更改AlertDialog消息 [英] Refresh or change the AlertDialog Message

查看:75
本文介绍了刷新或更改AlertDialog消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个AlertDialog

I create an AlertDialog

AlertDialog.Builder builder = new AlertDialog.Builder(this);
...
AlertDialog alert = builder.create();
alert.show();

过一会儿,我想更改AlertDialog消息而不关闭它.

After a moment I want to change the AlertDialog message without closing it.

有可能吗?

推荐答案

是的,可以.

例如,如果您使用自己的布局创建自己的对话框,则可以为每个视图设置一个id,然后访问每个视图(例如textView)并在需要时设置其新文本.

For example, if you create your own dialog, with your own layout, you can set an id for each of the views, and then access each of them (for example the textView) and set its new text whenever you wish to.

这篇关于刷新或更改AlertDialog消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆