title: need to run tasks only after Async task has finished
body: <p>How do i make sure that the async tasks finishes before i run certain tasks.  I need to use a variable AFTER the async tasks changes the value of that variable.  If i run the code before async is done running then im screwed. any help? im obviously new to async tasks.  If you look at my code im probably not using onPostExecute() as it was intended so advice would be helpful. My initial thought was to keep adding things to the async task but im thinking that this is just bad practice since i have tons of things that must be run in series.  Basically, what i think it boils down to is: how do i make sure that the tasks in the UI thread dont start to run before my async task has finished.</p>
  
  <pre><code>public class MainActivity extends MapActivity {
  myJSONmap;
  
  public void onCreate(Bundle savedInstanceState) {
  new AsyncStuff().execute();
  locatePlace(myJSONmap);
  
   class AsyncStuff extends AsyncTask&lt;Void, Integer, JSONObject&gt; {
              @Override
              protected JSONObject doInBackground(Void... params) {
                  jObject = GooglePlacesStuff.getTheJSON(formatedURL);
                  return null;
              }
              @Override
              protected void onPostExecute(JSONObject result) {
                  // TODO Auto-generated method stub
                  super.onPostExecute(result);
                  myJSONmap = JSONextractor.getJSONHMArrayL(jObject);  // getting the parsed data from the JSON object.
                  //the arraylist contains a hashmap of all the relevant data from the google website.
              }
          }
  </code></pre>