progressDialog = ProgressDialog.show(MainActivity.this, "", "Loading...");
Thread thread = new Thread() {
public void run() {
latch.countDown();
try{
sleep(3000);
}
catch (Exception e) {
Log.e("tag", e.getMessage());
}
progressDialog.dismiss();
}
};
thread.start(); listView.setAdapter(adapter);
我想在 3 秒内显示加载,然后显示列表视图,但列表总是立即显示。如何在显示列表视图之前完成线程?