比较费时间的代码放doInBackground里,应用会将doInBackground中的代码放入后台运行
public class BackstageThread extends AsyncTask <Void, Integer, Boolean> {
@Override
protected Boolean doInBackground(Void... params) {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return null;
}
}
159



被折叠的 条评论
为什么被折叠?



