GetLogin Class to return a value
<p>i can't figure out how to retrieve a value from a GetLogin class i have that extends AsyncTask. Here's my code:</p>

<pre><code>public class GetLogin extends AsyncTask&lt;String, Void, String&gt; {

private final HttpClient httpclient = new DefaultHttpClient();

final HttpParams params = httpclient.getParams();
HttpResponse response;
private String content =  null;
private Context mContext;

public GetLogin(Context context){

    this.mContext = context;

}

protected String doInBackground(String... urls) {

    String result = null;

    try {

        DefaultHttpClient httpClient=new DefaultHttpClient();

        Log.e("Tag", "url: " + urls[0]);

        //Connect to the server
        HttpGet httpGet = new HttpGet(urls[0].toString());

        //Get the response
        HttpResponse httpResponse = httpClient.execute(httpGet);
        HttpEntity httpEntity = httpResponse.getEntity();
        InputStream stream = httpEntity.getContent();

        //Convert the stream to readable format
        result = convertStreamToString(stream);
        Log.e("Tag", "Result: " + result);

        if (result.charAt(1)=='1') {
            return "Login Successful";
        } if (result.charAt(1)=='0') {
            return "Login Failed";
        } else {
            return result.toString();
        }

  //  } catch (ClientProtocolException e) {
  //      Log.w("HTTP2:",e );
 //       content = e.getMessage();
  //      cancel(true);
  //      return "Could not connect to Server";
   //     
   // } catch (IOException e) {
   //     Log.w("HTTP3:",e );
   //     content = e.getMessage();
   //     cancel(true);
   //     return "Could not connect to Server";

    }catch (Exception e) {
        Log.w("HTTP4:",e );
        content = e.getMessage();
        cancel(true);
        return "Could not connect to Server";
    }
}

public static String convertStreamToString(InputStream is) 
{
    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
    StringBuilder sb = new StringBuilder();

    String line = null;
    try {
        while ((line = reader.readLine()) != null) {
            sb.append(line + "\n");
        }
    } 
    catch (IOException e) {
        e.printStackTrace();
    } 
    finally {
        try {
            is.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    return sb.toString();
}
</code></pre>

<p>}</p>

<p>Here's the code for Login Activity</p>

<pre><code>    String url = "http://192.168.1.107:6972/evalservice/checkLogin?name="+tvUsername.getText()+"&amp;pass="+tvPassword.getText();
    new GetLogin(LoginActivity.this).execute(url);
</code></pre>

<p>what i would like to do is put an if statement to see if login was successfull and if so, proceed to the next activity</p>
