如何在启动应用程序期间显示progressDialog。我在oncreate方法中显示了progressDialog,并且在启动应用程序时没有显示。
我经历过这个: ProgressDialog not showing until after function finishes
我尝试过为上述问题解释的解决方案。但它没有完美运作。
这是我的代码:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dash);
progressDialog = ProgressDialog.show(this, "", "Loading...");
//Run background UI thread
Thread laucherThread = new Thread(new Runnable() {
public void run() {
Looper.prepare(); //I had to include this to prevent force close error
startService(new Intent(DroidChirp.this,ChirpService.class));
doBindService();
Log.e(MY_DEBUG_TAG, "Prepairing to close the dialog");
runOnUiThread(new Runnable() {
public void run() {
progressDialog.dismiss();
}
});
Log.e(MY_DEBUG_TAG, "Closed the dialog");
}
});
laucherThread.start();
}
我需要做的是:
我面临的问题:
任何人都可以建议我如何建立此功能。它是一个tablelayout,每个选项卡都有列表视图。