title: How can I return value from onResponse of Retrofit v2
body: <p>I want to return a string value from my function. But I do not know how to handle it? I tried final one-array solution but it did not work out.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public String revealCourtPlace(String courtID)
  {
  
      BaseService.getInstance().getUniqueCourt(Session.getToken(),courtID).enqueue(new Callback&lt;JsonObject&gt;()
      {
          @Override
          public void onResponse(Call&lt;JsonObject&gt; call, Response&lt;JsonObject&gt; response)
          {
  
              JsonObject object = response.body();
              boolean success = object.get("success").getAsBoolean(); //json objesinde dönen success alanı true ise
              if (success)
              {
                  JsonArray resultArray = object.get("data").getAsJsonObject().get("result").getAsJsonArray();
                  for (int i = 0; i &lt; resultArray.size(); i++)
                  {
                      JsonObject jsonInfoResult = resultArray.get(i).getAsJsonObject();
                      String courtName=jsonInfoResult.get("name").getAsString();
                  }
  
              }
  
          }
  
          @Override
          public void onFailure(Call&lt;JsonObject&gt; call, Throwable t)
          {
  
          }
  
      });
  
      //return ?
  }
  </code></pre>