求助:ProgressDialog闪一下就消失了?
为什么:ProgressDialog闪一下就消失了?谢谢!
private void progressDialg(){
dialog = ProgressDialog.show(getActivity(), "加载中...", "正在启动QQ...请等待!!",true,true);
Thread thread = new Thread(new Runnable() {
public void run() {
Message message = new Message();
message.what = 0;
mHandler.sendMessage(message);
}
});
thread.start();
}
//等待界面
private Handler mHandler =new Handler(){
public void handleMessage(Message msg)
{
if (msg.what == 0) {
Intent intent = new Intent(this, test.class);
startActivity(intent);
dialog.cancel();
}
}
}; ProgressDialog
[解决办法]