public void showProgress() { loadingDialogFragment = new DxlLoadingDialogFragment(); loadingDialogFragment.setLoadingString( TextUtils.isEmpty(loadingString) ? "加载中..." : loadingString); loadingDialogFragment.setCancelable(isCancleable); loadingDialogFragment.setOnCancelListener(onCancelListener); FragmentTransaction ft = baseActivity.getSupportFragmentManager().beginTransaction(); ft.add(loadingDialogFragment, "loadingDialogFragment"); if (ft != null && !baseActivity.isFinishing()) ft.commitAllowingStateLoss(); }
public void dismissProgress() { if (loadingDialogFragment != null && !baseActivity.isFinishing()) { loadingDialogFragment.dismissAllowingStateLoss(); } }