title: How to check response code on Android retrofit?
body: <p><strong>CODE:</strong></p>
  
  <pre><code>Call&lt;ResponseBody&gt; call = postApiService.uploadFile(body, coordinatePoint, textToPost);
  call.enqueue(new Callback&lt;ResponseBody&gt;() {
      @Override
      public void onResponse(Call&lt;ResponseBody&gt; call, Response&lt;ResponseBody&gt; response) {
          if(response.isSuccessful()){
              Toast.makeText(getContext(), response.code(), Toast.LENGTH_LONG).show();
          }
          else {
              Toast.makeText(getContext(), response.code(), Toast.LENGTH_LONG).show();
          }
      }
      @Override
      public void onFailure(Call&lt;ResponseBody&gt; call, Throwable t) {
          Toast.makeText(getContext(), getString(R.string.check_internet), Toast.LENGTH_LONG).show();
      }
  </code></pre>
  
  <p>On this code, i think error is on <code>response.code()</code></p>
  
  <p>Because error code is like
  <code>android.content.res.Resources$NotFoundException: String resource ID #0xc9</code></p>
  
  <p>on that <code>Toast.makeText(getContext(), response.code(), Toast.LENGTH_LONG).show();</code></p>
  
  <p>So, how to get response code on android retrofit2?</p>
  
  <p>Please would you let me know about it?</p>