showing dialog while loading layout by setContentView in background
问题 I am using below code where , i want to show dialog in front and loading content in background but not able to do the same . Please advise. dialog = ProgressDialog.show(this, "", "Loading. Please wait...", true); runOnUiThread(new Runnable(){ public void run() { setContentView(R.layout.main_layout); dialog.dismiss(); } }); 回答1: I got solution by reading below link and implemented code as below: http://developer.android.com/guide/appendix/faq/commontasks.html#threading int glb=0,glbtotal=3;