title: Android: How to pass an object from a simple class to an Activity
body: <p>I have the following problem. 
  I have a class named "A" in which I create a list "List dStruct" . 
  I modify this object in the "A" class and I want to pass it to an Activity for further use.</p>
  
  <p>Also the "A" class extends AsyncTask.</p>
  
  <p>In this case,how do I pass an object to an Activity?</p>
  
  <p>Here is the Activity Code:
  <code></p>
  
  <p>List  dStruct; //the object I want to access</p>
  
  <p>btnPlanTrip.setOnClickListener(new OnClickListener() {</p>
  
  <pre><code>     tripReq = new TripRequest(MainActivity.this);
       tripReq.execute(request);
       dStruct=tripReq.dStruct;
  
  
       String str= dStruct.get(0).name;
  
  }
  </code></pre>
  
  <p></code></p>
  
  <p>Here is the code for the class "A"</p>
  
  <p><code>
  public class TripRequest extends AsyncTask {</p>
  
  <p>List  dStruct;</p>
  
  <pre><code> public TripRequest(MainActivity activity) {
      this.activity = activity;
      dStruct=new ArrayList &lt;DirectionsStruct&gt;();
      progressDialog = new ProgressDialog(activity);  
  </code></pre>
  
  <p>}</p>
  
  <p>protected void onPostExecute(Long result) {</p>
  
  <pre><code>   code for dStruct 
  
   }
  </code></pre>
  
  <p>}
  </code></p>