我有 TabActivity,每个选项卡都有 ActivityGroup。在 Forth 选项卡中,ForthActivityGroup 有一个 MyAsyncActivity 类。在 MyAsyncAcitivity 我有这个代码。我有这个 Android AsyncTask 代码。在 Android 2.3.3 上调用 doInBackground(String.. params) 并打印日志,但在 Android 4.0 上未打印。请有人给我想法我做什么?
public class getXML extends AsyncTask<String, Integer, String>{
private final ProgressDialog dialog = new ProgressDialog(this);
@Override
protected void onPreExecute() {
this.dialog.setMessage("Loading...");
this.dialog.show();
}
@Override
protected String doInBackground(String... params) {
Log.d("Payment", "do background");
return "result";
}
@Override
protected void onPostExecute(String result) {
if (this.dialog.isShowing()) {
this.dialog.dismiss();
}
}