• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

If and else Error

 
Ranch Hand
Posts: 92
Android
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question :: In if and else block i want my email and pass verify then go the next activity .. if email == email and pass == pass proceed

What is Happening  it only check the email not the password .. if the email match it proceed to the next activity no matter what i enter password .. Whats the problem in my code :


 
Saloon Keeper
Posts: 7597
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first thing to do is to print out the values of all of email, signInEmail.getText().toString(), pass and signInPassword.getText().toString() to make sure that they are what you think they are.
 
Saad Zahoor
Ranch Hand
Posts: 92
Android
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yup ... i print all the entered values .. that part works fine ... problem is

Suppose i set my email to k@gmail.com and password is kkk  in Sign up Activity

but in Sign in activity when i type email as k@gmail.com and if i type wrong password as sss . it still load up the display activity where all the info is shown

i don't understand in program i said id email and password ! = setup email and setup pass display alert pop up ??
 
Tim Moores
Saloon Keeper
Posts: 7597
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you saying that even though the if conditions in both lines 5 and 6 evaluate to "true", code execution resumes in line 38 rather than line 8? That is not possible - if the condition in line 5 evaluates to true, line 38 becomes unreachable. I suggest to sprinkle logging statements liberally throughout the code so you know the values of all involved variables, and the execution path taken.

If the problem does not become clear when you do that, post the altered code here, along with the values of relevant variables and expressions.
 
Saad Zahoor
Ranch Hand
Posts: 92
Android
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply .. Just figured out what i was missing i should use or instead of and operator...  
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic