title: How to pass variables in and out of AsyncTasks?
body: <p>I haven't spent much time working with <code>AsyncTasks</code> in Android. I'm trying to understand how to pass variables to and from the class. The syntax:</p>
  
  <pre><code>class MyTask extends AsyncTask&lt;String, Void, Bitmap&gt;{
  
       // Your Async code will be here
  
  }
  </code></pre>
  
  <p>it's a little bit confusing with the <code>&lt; &gt;</code> syntax on the end of the class definition. Never seen that type of syntax before. It seems like I'm limited to only passing one value into the <code>AsyncTask</code>. Am I incorrect in assuming this? If I have more to pass, how do I do that?</p>
  
  <p>Also, <strong>how do I return values from the AsyncTask?</strong>  <br></p>
  
  <p>It's a class and when you want to use it you call <code>new MyTask().execute()</code> but the actual method you use in the class is <code>doInBackground()</code>. So where do you actually return something?</p>