Nidheesh
Nidheesh

Reputation: 672

Default inputType of EditText in android

Suppose I have an EditText in my layout.

<EditText
    android:id="@+id/username"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:hint="@string/username"
    />

We can set the inputType for this EditText as text, number, phone, textPassword, etc. What will be the inputType of the EditText by default?

Upvotes: 17

Views: 7919

Answers (5)

Favas Kv
Favas Kv

Reputation: 3099

After some research found that default Edittext InputType will be InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE

Which is Hex:0x20001 or Decimal: 131073

Upvotes: 20

Farhan Shah
Farhan Shah

Reputation: 2342

By Default it will be always:

android:inputType="textPersonName"

Upvotes: -5

jyomin
jyomin

Reputation: 1967

Just plain old text. Corresponds to TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_NORMAL.

Upvotes: 1

Sharad Mhaske
Sharad Mhaske

Reputation: 1103

you mean default keyboard is the device default keyboard if you dont specified inputType to Edittext in xml.Hope this helps you to understand.

Upvotes: 0

Gabe Sechan
Gabe Sechan

Reputation: 93728

It will be text with no special options. So just TYPE_CLASS_TEXT

Upvotes: 12

Related Questions