Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 995
Nidheesh Avatar asked Mar 20 '14 06:03

Nidheesh


People also ask

What is the EditText attribute android inputType used for?

The android:inputType attribute allows you to specify various behaviors for the input method. Most importantly, if your text field is intended for basic text input (such as for a text message), you should enable auto spelling correction with the "textAutoCorrect" value.

How do I change the default value in EditText?

You can use the setHint() to set it, or set it in XML (though you probably don't want that, because the XML doesn't 'know' the name/adress of your user :) ) Show activity on this post. You can use EditText. setText(...) to set the current text of an EditText field.

How do I change the default value of text in Android Studio?

editText. setText("Your default text");

What is plain text in Android Studio?

Plaintext is nothing but the Edittext. It has changed the name in Android studio but if you check into Design view you will get to know that it still has name of Edittext only. Usages. Textview : should be used for uneditable text which user wants to read but not to manipulate. e.g. News, Articles, Blogs.


1 Answers

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

like image 168
Favas Kv Avatar answered Sep 21 '22 17:09

Favas Kv