publishProgress from inside a function in doInBackground?

前端 未结 5 776
名媛妹妹
名媛妹妹 2020-12-15 17:20

I use an AsyncTask to perform a long process.

I don\'t want to place my long process code directly inside doInBackground. Instead my long process code is located in

5条回答
  •  清酒与你
    2020-12-15 18:08

    When you say "my long process code is located in another class that I call in doInBackground", do you mean "located in another method that I call in doInBackground"?

    If so, you could make that method a private method of your AsynTask class. Then you could call publishProgress inside the method whenever needed.

提交回复
热议问题