public void closeLoadingDialog() {

    if (loadingDialog != null && loadingDialog.isShowing()) loadingDialog.dismiss();
  }
  public void showLoadingDialog() {

    loadingDialog = new LoadingDialog(mainActivity);
    loadingDialog.show();
  }