diff --git a/volleysinglecall/src/main/java/com/awais/volleysinglecall/NetworkController.java b/volleysinglecall/src/main/java/com/awais/volleysinglecall/NetworkController.java index 0ff2d9e..90234c2 100644 --- a/volleysinglecall/src/main/java/com/awais/volleysinglecall/NetworkController.java +++ b/volleysinglecall/src/main/java/com/awais/volleysinglecall/NetworkController.java @@ -34,15 +34,10 @@ public NetworkController(Context ctx) { private boolean finishActivity = false; private boolean shouldLogout = false; private boolean showLoadingDialog = false; - private LoadingDialog loadingDialog; private boolean showDialog = true; public LoadingDialog getLoadingDialog() { - return loadingDialog; - } - - public void setLoadingDialog(LoadingDialog loadingDialog) { - this.loadingDialog = loadingDialog; + return LoadingDialog.getInstance(context); } public boolean isFinishActivity() { @@ -91,8 +86,7 @@ public void callService(int requestType, String serviceName, final HashMap objectClass, final VolleyResponse calls) { if (isShowLoadingDialog()) { - loadingDialog = LoadingDialog.getInstance(context); - loadingDialog.showDialog(); + getLoadingDialog().showDialog(); } final VolleyQueue volleyQueue = VolleyQueue.getInstance(context); StringRequest request = new StringRequest(requestType, @@ -101,7 +95,7 @@ public void callService(int requestType, String serviceName, final HashMap