title: How to return value from async task in android
body: <p>I created an async task to call my server to get data from DB.<br>
  I need to process the result returned from http server call.<br>
  From my activity i calling the async task in many places. so i cant use member variable to access the result. is there any way to do?  </p>
  
  <pre><code>public Result CallServer(String params)
  {
  
      try
      {
      new MainAynscTask().execute(params);
      }
      catch(Exception ex)
      {
          ex.printStackTrace();
      }
      return aResultM;//Need to get back the result
  
  }  
  
      private class MainAynscTask extends AsyncTask&lt;String, Void, Result&gt; {
  
  
      @Override
      protected Result doInBackground(String... ParamsP) {    
          //calling server codes
          return aResultL;
      }       
      @Override
         protected void onPostExecute(Result result) {
            super.onPostExecute(result);
            //how i will pass this result where i called this task?
         }
  </code></pre>