How can I ensure that the text entered on this edittext is nothing but 13digits. This is my attempt but the user can enter 5 digits but I want it 13 digits
<EditText
android:id="@+id/phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="phone"
android:maxLength="13"
android:layout_below="@+id/TextView01"
android:layout_centerHorizontal="true"
android:ems="10"/>
updated codes
final EditText phone = (EditText)findViewById(R.id.phone);
InputFilter[] filterArray = new InputFilter[1];
filterArray[0] = new InputFilter.LengthFilter(11);
phone.setFilters(filterArray);
if(Double.parseDouble(phone.getText().toString()) > 11)
{
//the above if text always fails
}