android - how to check the text in first two buttons equals to the text in third button -
here code .this doesn't work
button1.gettext() + button2.gettext() == button3.gettext()
use equals
compare strings,
try this,
string button1text = button1.gettext().tostring(); string button2text = button2.gettext().tostring(); string button3text = button3.gettext().tostring(); if((button1text + button2text).equals(button3text)){ // strings equal } else { // strings not equal }
Comments
Post a Comment