I am receiving the value as true when log.d ing the logcat , but when I assign the value to boolean variable it changes to false and also I am not able to do the if condition with the value as it also is showing false. That is I am only able to get the value as true in log, dont know how to take the value to a variable or check some conditions. This code is used for validate a phone number