title: How to get the return value from onpostexecute method in android?
body: <p>I am working on android application. I need to get the value from onpostexecute method. i.e I need to do some tasks with the return value from onpostexecute method. How can I achieve that? Please help me in this regard.</p>
  
  <p>My code:</p>
  
  <pre><code>boolean val= false;
  
  
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          LongOperation1 op = new LongOperation1();
              op.execute("");
  //I want the value here again
  
  
  }
  
  private class LongOperation1 extends AsyncTask&lt;String, Void, String&gt; {
  
          @Override
          protected String doInBackground(String... params) {
  
              loadFeed2();
              return "Executed";
          }
              @Override
          protected void onPostExecute(String result) {
              dialog1.dismiss();
              try {
                       dialog.dismiss();
  //mystuff
                  val = true;
  
  
          }
              catch (Exception e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
          @Override
          protected void onPreExecute() {
              dialog1 = ProgressDialog.show(Taketest.this, "Please wait...",
                      "Retrieving data ...", true);
          }
  
          @Override
          protected void onProgressUpdate(Void... values) {
          }
      }
  </code></pre>