-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 02/09/2011 03:24 PM, Atif Musaddaq wrote:
> 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")
if ("true".equals(responseText))
> {
> // 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
- --
Marc Petit-Huguenin
Personal email: [email protected]
Professional email: [email protected]
Blog: http://blog.marc.petit-huguenin.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAk1TI+YACgkQ9RoMZyVa61ec9ACfTvys0ZQoWzbmaauhwV/SDlQF
to0AnA4YiFQSmgq1rvjIJk3YRzapgicp
=qFJL
-----END PGP SIGNATURE-----
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en