In android xml im file using editext as
<EditText
android:id="@+id/email"
android:layout_width="fill_parent"
android:layout_height="33dp"
android:inputType="textEmailAddress"
android:hint="Enter your mail id" />
In java file while checking this editext.
if(editextobj.getInputType()==InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS){
}
or
if(getInputType()==(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS)){
}
this condition does not work because it editextobj.getInputType()returns 33, while the developer's document gives a constant TYPE_TEXT_VARIATION_EMAIL_ADDRESSas 32
How to check input type programmatically?
source
share