diff --git a/app/src/main/java/com/mindorks/framework/mvp/ui/base/BaseFragment.java b/app/src/main/java/com/mindorks/framework/mvp/ui/base/BaseFragment.java index 70f0811..a6d2c41 100644 --- a/app/src/main/java/com/mindorks/framework/mvp/ui/base/BaseFragment.java +++ b/app/src/main/java/com/mindorks/framework/mvp/ui/base/BaseFragment.java @@ -36,7 +36,6 @@ public abstract class BaseFragment extends Fragment implements MvpView { private BaseActivity mActivity; private Unbinder mUnBinder; - private ProgressDialog mProgressDialog; @Override public void onCreate(@Nullable Bundle savedInstanceState) { @@ -62,14 +61,15 @@ public void onAttach(Context context) { @Override public void showLoading() { - hideLoading(); - mProgressDialog = CommonUtils.showLoadingDialog(this.getContext()); + if (mActivity != null) { + mActivity.showLoading(); + } } @Override public void hideLoading() { - if (mProgressDialog != null && mProgressDialog.isShowing()) { - mProgressDialog.cancel(); + if (mActivity != null) { + mActivity.hideLoading(); } }