Android ASync task ProgressDialog isn't showing until background thread finishes

后端 未结 4 462
遇见更好的自我
遇见更好的自我 2020-12-01 14:37

I\'ve got an Android activity which grabs an RSS feed from a URL, and uses the SAX parser to stick each item from the XML into an array. This all works fine but, as expected

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-01 15:21

    This works for me

    @Override
    protected void onPreExecute() {
            dialog = new ProgressDialog(viewContacts.this);
            dialog.setMessage(getString(R.string.please_wait_while_loading));
            dialog.setIndeterminate(true);
            dialog.setCancelable(false);
            dialog.show();
        }
    

提交回复
热议问题