Hi, Guys

I am sending some data to the PHP server and based on this data server is
sending "true" or "false" back to me.

e.g

echo "true";
OR
echo "false";

Now on the android side i write this code in Post method

  try {
post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = client.execute(post);
    HttpEntity entity = response.getEntity();
    String responseText = EntityUtils.toString(entity);
    Toast.makeText( getApplicationContext(),
responseText,Toast.LENGTH_SHORT).show();
            Log.i("Output",responseText);

            // till here it is showing me either true or false
    if (responseText == "true")
            {
          // call activity A
    }else{

                  // call activity B
    }

Now it shows me response either true or false based on the data i send. but
it is not comparing the if condition. i would like to further call Activity
A or B based on  true or false.

Can any one help me and tell me what i am doing wrong here ? why it is
not comparing the condition ? responseText is already string and
also comparing String

-- 
Atif Musaddaq

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to