Waiting till the async task finish its work

前端 未结 5 457
说谎
说谎 2020-11-28 21:39

I\'m very new to programming and I have some doubts.

I have a AsyncTask which is I call as RunInBackGround.

and I start this proc

5条回答
  •  天涯浪人
    2020-11-28 22:21

    In your AsyncTask add one ProgressDialog like:

    private final ProgressDialog dialog = new ProgressDialog(YourActivity.this);
    

    you can setMessage in onPreExecute() method like:

    this.dialog.setMessage("Processing..."); 
    this.dialog.show();
    

    and in your onPostExecute(Void result) method dismiss your ProgressDialog.

提交回复
热议问题