title: Android HTTP-post AsyncHttpClient New thread issue
body: <p>Recently I posted a question about the Android HTTP-post AsyncHttpClient. It is located here: <a href="https://stackoverflow.com/questions/11424624/android-http-post-asynchttpclient">Android HTTP-post AsyncHttpClient</a> The following is the updated method. As you can see this is a boolean method. I have the done variable as a global variable and when the user clicks the Login button I check if postLoginData returned true or false. I need to move on to another activity if true otherwise I show a dialog. But done is being set to true in a new thread and I cannot really have my main thread be waiting because that will cause another error. I'm not sure of what should be my work around. I am hoping someone would post a tutorial that uses AsyncHttpClient to login.</p>
  
  <pre><code>public boolean postLoginData(String userid, String password) {
      done = false;
      params1.put("username", "");
      params1.put("password", ""); 
      Log.d("addteq", "Start Get Post"); 
      AsyncHttpClient myClient = new AsyncHttpClient();
      myClient.post("http://192.168.2.108/htdocs/?action=login",
              params1, new AsyncHttpResponseHandler() {
                  @Override
                  public void onSuccess(String response) {
                      done = true;
                      System.out.println("login success");
                  }
              });
      return done;
  }
  </code></pre>