为什么: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
------解决方案--------------------
http://blog.csdn.net/zhangxu365/article/details/7942654
建议参考下
------解决方案--------------------
设置一个标记位,当你愿意让dialog 消失的时候 你才让Thread 发送消息