Skip to content Skip to sidebar Skip to footer

Edittext Inputtype Constant Value Doesnot Match

In android xml file im using editext as

Decimal: 32|1 results in 33 Binary: 100000|1 results in 100001 which is 33 in decimal.

editextobj.getInputType() value is 33

Solution 2:

There is nothing wrong with your code. 32 stays for TYPE_TEXT_VARIATION_EMAIL_ADDRESS. Also it's a flag, so you should test it like this. See InputType example(at the top under class overview) for more details.

if(editextobj.getInputType() & InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS == 1){

}

Solution 3:

You need to test each flag separately, e.g.:

if ( ( editextobj.getInputType() & InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS) != 0)
{
     // This is an email address!
}

Solution 4:

Try this:

if(editextobj.getInputType() == (InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS + 1)) {....}

Post a Comment for "Edittext Inputtype Constant Value Doesnot Match"