public class IdAsync extends AsyncTask<String, Void, Void> {
AlertDialog alertDialog = new AlertDialog.Builder(MainClass.this).create();
protected Void doInBackground(String... params) {
.
.
alertDialog.setTitle("Reset...");
alertDialog.setMessage("R u sure?");
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
//here you can add functions
} });
alertDialog.show();
.
.}
这给出了运行时错误 发生错误E/AndroidRuntime(16606):在android.app.Dialog.show(Dialog.java:241)AlertBox - 执行doInBackground()
谢谢你的工作.. – 2012-02-07 09:38:23