title: Trying to Call An Api on Success will get the Data, But on Failure it Dismisses the Dialog and Displays Blank Plage
body: <p>How To Call The Api Service Again on failure to Display the data, On Failure Will get A Blank Screen after the Progress Dialog Ends.</p>
  
  <p>public void setSemesterData() {</p>
  
  <pre><code>    progressDialog=new ProgressDialog(context, R.style.MyAlertDialogStyle);
      progressDialog.setMessage("Loading..Please Wait");
      progressDialog.setIndeterminate(false);
      progressDialog.setCancelable(false);
      progressDialog.show();
      apiService= RetroClient.getApiService();
      Call&lt;SemesterModel&gt; call=apiService.getSemester(id);
      call.enqueue(new Callback&lt;SemesterModel&gt;() {
          @Override
          public void onResponse(Call&lt;SemesterModel&gt; call, Response&lt;SemesterModel&gt; response) {
              progressDialog.dismiss();
  
  
              if(response.isSuccessful())
              {
  
                  semesterList.clear();
                  semesterList.addAll(response.body().getData());
                  semesterAdapter.notifyDataSetChanged();
              }
          }
  
          @Override
          public void onFailure(Call&lt;SemesterModel&gt; call, Throwable f) {
              progressDialog.dismiss();
          }
      });
  
  }
  </code></pre>