这就是我创建 PorgressDialog 的方式:
... progressBarDialog = new ProgressDialog( context );
progressBarDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressBarDialog.show(this, "Please Wait", "Updating your GPS coordinates",false,true);
//Trigger GPS service to update coordinates
fg.myOnresume(Name);
fg.dontSendSMS();
//Sets the timer at 30 secs
timer= new Timer();
timer.schedule(new startMapActivity());
}
class startMapActivity extends TimerTask
{
@Override
public void run()
{
//handler.sendEmptyMessage(0);
Log.d("", "StartMapActivty--->>>run()");
// Dismissing Dialog Box
if(progressBarDialog.isShowing())
{
progressBarDialog.dismiss();
}
}
}
所以基本上在 30 秒后计时器完成后,我想关闭对话框,但它不起作用:(请帮忙。