简体   繁体   English

进度对话没有显示库koush / ion

[英]progress dialogue not showing with the library koush/ion

This is my code. 这是我的代码。 The problem is the progress dialogue is not showing, so the default text on the text view is showing and after some time the URL content is loaded into it. 问题是进度对话框没有显示,因此显示文本视图上的默认文本,并在一段时间后将URL内容加载到其中。 How can I fix this? 我怎样才能解决这个问题?

tv = (TextView) findViewById(R.id.textView1);
pd = new ProgressDialog(MainActivity.this);
Ion.with(getBaseContext()).load("https://google.com")
.progressDialog(pd)
.asString()
.setCallback(new FutureCallback() {

        @Override
        public void onCompleted(Exception arg0, String arg1) {
            // TODO Auto-generated method stub
            tv.setText(arg1);
        }
    });

I posted this issues on github and got this response from user kouch 我在github上发布了这个问题并得到了用户kouch的回复

Must call show/cancel yourself. 必须自己致电显示/取消。

This is because the progress dialog may be linked to further work/progress, or show errors, etc. I left management of the dialog up to the callee. 这是因为进度对话框可能与进一步的工作/进度相关联,或显示错误等。我将对话框的管理权交给被调用者。 Leaves room for flexibility. 留出灵活空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM