title: Get returned value of interface method
body: <p>I have implemented this interface:</p>
  
  <pre><code>public interface Callback {
      public abstract ArrayList&lt;String&gt; done(ArrayList&lt;Document&gt; docs);
  }
  </code></pre>
  
  <p>Also this method:</p>
  
  <pre><code> public void getNearUsers(Callback callback, LatLng loc) {
          new GetNearUsersASyncTask(callback, loc).execute();
      }
      public class GetNearUsersASyncTask extends AsyncTask&lt;Void, Void, ArrayList&lt;Document&gt;&gt;{
          Callback callback;
          LatLng loc;
          ArrayList&lt;Document&gt; documents;
  
          public GetNearUsersASyncTask(Callback callback, LatLng loc){
              this.callback=callback;
              this.loc=loc;
              documents = new ArrayList&lt;&gt;();
          }
  
          @Override
          protected ArrayList&lt;Document&gt; doInBackground(Void... params) {
  
              ...
  
              return documents;
          }
          @Override
          protected void onPostExecute(ArrayList&lt;Document&gt; docs) {
              ...
              callback.done(docs);
              super.onPostExecute(docs);
          }
      }
  </code></pre>
  
  <p>And finally this one:</p>
  
  <pre><code>    public ArrayList&lt;String&gt; gotoRec() {
          final ArrayList&lt;String&gt; finalPostIDs = new ArrayList&lt;&gt;();
                  serverRequest.getNearUsers(new Callback() {
                      @Override
                      public ArrayList&lt;String&gt; done(ArrayList&lt;Document&gt; users){               
                          ...
                          return finalPostIDs;
                      }
                  }, loc);
  
              }
          });
          //return the finalPostIDs of override method;
      }
  </code></pre>
  
  <p>My question is this:</p>
  
  <p>How can i have the finalPostIDs returned ArrayList of Callback interface to return it in gotoRec method ? Is there a way or should i take another road ?</p>