我正在使用 google api lib 创建地图。因为 mapwidget 需要很长时间才能加载,所以我尝试添加加载通知,但未显示。我可以在常规线程中显示progressDialog。这个对话框怎么不显示?
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
progressDialog = ProgressDialog.show(this, "Please Wait", "Map = loading",false,true);
//setContentView(R.layout.map);
runOnUiThread(new Runnable(){
public void run() {
try{
Log.d("debug", "before setContentView"); //13:36:25
setContentView(R.layout.map);
Log.d("debug", "after setContentView"); //13:36:39
} catch (Exception e) { }
progressDialog.dismiss();
}});
initMap();
initGps();
}