title: android -How to return value from asyncTask
body: <p>i want to get the value returns by asynctask after it's been completed. this is my code :</p>
  
  <pre><code>class asyncGet extends AsyncTask&lt;Void, String, String&gt; {
      Boolean goterror = false;
  @Override
  protected String doInBackground(Void... params) {
      HttpClient client = new DefaultHttpClient();
      HttpGet request = new HttpGet(url);
      HttpResponse response;
      try {
          request.setHeader("Cache-Control", "no-cache");
          request.setHeader("Cache-Control", "no-store");
          response = client.execute(request);
          response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
          response.setHeader("Pragma", "no-cache");
          InputStream in = response.getEntity().getContent();
          BufferedReader reader = new BufferedReader(new InputStreamReader(in));
          StringBuilder str = new StringBuilder();
          String line = null;
          while ((line = reader.readLine()) != null) {
              str.append(line);
          }
          in.close();
          return str.toString();
      } catch (Exception e) {
          goterror = true;
      }
  
      return null;
  }
  
  @Override
  protected void onPostExecute(String result) {
      super.onPostExecute(result);
      if (pDialog != null &amp;&amp; pDialog.isShowing())
          pDialog.dismiss();
  
      if (result != null &amp;&amp; goterror == false) {
  
  }
  
  
  }
  </code></pre>
  
  <p>The async is in another class , I want to show the result when it's done . </p>
  
  <p>How can I return the result from the async ? </p>
  
  <p>thanks </p>