如何显示一个消息"成功&QUOT登记; [英] How to show a message " Registered Successfully"

查看:190
本文介绍了如何显示一个消息"成功&QUOT登记;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我米显示了5000毫秒一个对话框,现在我要显示注册成功的对话框消失后的消息。我怎样才能做到这一点?

感谢$问候。

下面是code

 按钮登入=(按钮)findViewById(R.id.regsubmitbtn);    signin.setOnClickListener(新OnClickListener(){
        公共无效的onClick(视图v){
            的ShowDialog(0);
            T =新的Thread(){
                公共无效的run(){
                    寄存器();
                    尝试{
                        视频下载(5000);
                        removeDialog(0);
//我想告诉喜欢去除这个对话框后,成功注册对话框//
            }赶上(InterruptedException的E){
                e.printStackTrace();
            }
                }
            };
            t.start();
        }
    });
       @覆盖
保护对话框onCreateDialog(INT ID){
    开关(ID){
    情况下0:{
        对话框=新ProgressDialog(本);
        dialog.setMessage(注册...);
        dialog.setIndeterminate(真);
        dialog.setCancelable(真);
        返回对话框;
    }
    }
    返回null;
}


解决方案

而不是使用DialogBox的,你可以用一个面包对象。这可以被配置在一定时间后消失。

http://developer.android.com/guide/topics/ UI /通知者/ toasts.html

I m showing a dialog box for 5000ms now I want to show a message "Registered successfully" after that dialog box disappears. How can I do this?

Thanks$Regards.

Here is the code

   Button signin = (Button) findViewById(R.id.regsubmitbtn);

    signin.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            showDialog(0);
            t = new Thread() {
                public void run() {
                    register();
                    try {
                        Thread.sleep(5000);
                        removeDialog(0);
//   I want to show the dialog box like registered successfully after removing this dialog//
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
                }
            };
            t.start();
        }
    });
       @Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case 0: {
        dialog = new ProgressDialog(this);
        dialog.setMessage("Registering...");
        dialog.setIndeterminate(true);
        dialog.setCancelable(true);
        return dialog;
    }
    }
    return null;
} 

解决方案

Instead of using a Dialogbox, you can use a Toast object. This can be configured to disappear after a certain time.

http://developer.android.com/guide/topics/ui/notifiers/toasts.html

这篇关于如何显示一个消息"成功&QUOT登记;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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