Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 11 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
此处的开发人员指南中给出了一个示例。
An example is given in the developer guide over here.
如果 AsyncTask 在前台运行,您应该使用它。
使用 AsyncTask,您可以在 UI 中运行使用
activity.runOnUiThread(new Runnable()) 更新的进度
尝试一下,看看它是否是您正在寻找的:)
希望这有帮助。
You should be using an AsyncTask if it's running in the foreground.
With an AsyncTask you can run things in the UI on progress updated with
activity.runOnUiThread(new Runnable())
Give this a try, see if it is what you're looking for :)
Hope this helped.