假设我的应用程序中有此代码AlertDialog.Builder(context)
。问题是Thread
它将运行在哪个位置?
final Thread myPrettyOperation = new Thread() {
@Override
public void run() {
//Do some really long operation.
}
};
class MyPrettyTask extends
AsyncTask<Void, Integer, Boolean> {
protected Boolean doInBackground(
Void... voids) {
myPrettyOperation.start();
return true;
}
protected void onProgressUpdate(
Integer... progress) {
}
protected void onPostExecute(Boolean result) {
}
}
new MyPrettyTask().execute();