阻塞线程的办法

Dialog progressDialog = new Dialog(MainActivity.this, R.style.toast_dialog);
progressDialog.setContentView(View.inflate(MainActivity.this, R.layout.dialog_loading_base_layout, null), new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT
));
progressDialog.setCancelable(true);
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.getWindow().setDimAmount(0F);
progressDialog.show();
原文地址:https://www.cnblogs.com/liunx1109/p/14982526.html