简体   繁体   中英

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. 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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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