我试图在 AlertDialog 的 onClick 事件中显示一个 ProgressDialog,代码有效,但 ProgressDialog 似乎卡在 AlertDialog 后面,这使这一点失败
public class MainActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Title").setMessage("Message").setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ProgressDialog pd = ProgressDialog.show(MainActivity.this, "Title", "Text", true, false);