Progress dialog not showing with koush / ion library

This is my code. The problem is that the progress dialog is not displayed, so the default text is displayed in the text view and after a while the content of the url 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);
        }
    });

      

+3


source to share


1 answer


I posted these issues on github and got this answer from user kouch



Must call the show / cancel myself.

This is because the progress dialog can be related to further work / progress or display errors, etc. I left the dialog control up to the callee. Sheets for flexibility.

+1


source







All Articles