Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android EditText inputType textShortMessage

What is the purpose of inputType textShortMessage? How will this affect my application? Do certain keyboards, Android versions or applications treat this specially, or differently from just type text?

like image 553
William Avatar asked Mar 23 '15 21:03

William


People also ask

What is InputType in android?

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 can set input type number in android?

To get the input type use getInputType() . int inputTypeValue = editText. getInputType(); The InputType values are defined (in hexadecimal) in the documentation.

What is textPhonetic?

textPhonetic. Text that is for phonetic pronunciation, such as a phonetic name field in a contact entry. Corresponds to TYPE_CLASS_TEXT / TYPE_TEXT_VARIATION_PHONETIC . textWebEmailAddress. Text that will be used as an e-mail address on a web form.

What is textWebPassword?

Text that is a password that should be visible. Corresponds to. TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_VISIBLE_PASSWORD . textWebPassword.


Video Answer


2 Answers

Not that much difference between text and textShortMessage. While developing the Android Source, google developers felt to create two different class for two different cases. textShortMessage and textLongMessage both inherits the behaviour of text with some different attributes.

There could be so many types of input for a EditText. Android Developer made it easier for us to define the behaviour of a specific EditText.

textShortMessage is for: Variation of TYPE_CLASS_TEXT: entering a short, possibly informal message such as an instant message or a text message.

It means when we use textShortMessage as input type the EditText will open the alphabetic keyboard but the EditText will not be Expanded. If you change it to textLongMessage the EditText will be expanded for multiline text input.

SOURCE: http://developer.android.com/reference/android/text/InputType.html

like image 154
Mohammad Arman Avatar answered Sep 21 '22 12:09

Mohammad Arman


One difference :

android:inputType="textShortMessage|textMultiLine" 

Will give you the smiley button in preference to the enter key.

android:inputType="textMultiLine" 

Will give you the "enter" key again.

like image 25
RedHotPawn.com Avatar answered Sep 18 '22 12:09

RedHotPawn.com