title: How to show spinning icon while using retrofit 2 to get a response from Async Restful call
body: <p>I have used Square / Retrofit Restful framework to get data from a Restful service, and it works like a charm, code snippet is like below:</p>
  
  <pre><code>FooService restInterface =  new RestAdapter.Builder().setEndpoint(FooService.URL).build().create(FooService.class);
      restInterface.getAllFoos(new Callback&lt;FooModel&gt;() {
          @Override
          public void success(FooModel model, Response response) {
                  //get a list of Foo instances.
              }
              updateUI();
          }
  
          @Override
          public void failure(RetrofitError error) {
                  //log errors.
          }
  
      });
  </code></pre>
  
  <p>I understand this is an async call, however can I have a spinning icon on the top while retrofit is busy working on the background? In case the network is not available.</p>
  
  <p>Also is it possible to set a timeout so when the time is up, a prompt of options to continue waiting or abort the mission?</p>
  
  <p>I noticed there was something close on this site: <a href="https://stackoverflow.com/questions/33338181/is-it-possible-to-show-progress-bar-when-upload-image-via-retrofit-2/33384551#33384551">Is it possible to show progress bar when upload image via Retrofit 2</a> , but still couldn't figure it out how to do it. Besides, my requirement might be simpler.</p>