这是怎么了创建PorgressDialog:安卓:无法解雇ProgressDialog
... 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秒我想dimiss对话框,但它不工作:(请帮助。
好吧,我只是测试多一个方法..其这样:创建你的进步dialoge一样,progressDialoge P = ProgressDialoge.show(myContextVariable”标题”, “消息”);其中myContextVariable在onCreate()中像这样初始化:myContextVariable = this; //这个“这个”非常重要;否则你可能会得到一个错误......现在在处理程序中使用.Cancel函数来取消对话...希望它能够工作... – Farhan 2011-03-25 13:26:46