欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

Android 进度对话框 ProgressDialog

程序员文章站 2022-08-02 20:56:27
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); button = (Button) fin... ......
    protected void oncreate(bundle savedinstancestate) {
        super.oncreate(savedinstancestate);
        setcontentview(r.layout.activity_main);

        button = (button) findviewbyid(r.id.button);
        button.setonclicklistener(new onclicklistener() {

            @override
            public void onclick(view v) {
                // todo auto-generated method stub

                // progressdialog.show(mainactivity.this, "提示", "正在加载,请稍后...");
                progressdialog dialog = new progressdialog(mainactivity.this);
                dialog.settitle("提示");
                dialog.setmessage("正在加载,请稍后...");
                dialog.show();
            }
        });
    }