How to programmatically hide/disable emoticons on Android soft keyboard

ellen6a picture ellen6a · May 9, 2014 · Viewed 19.6k times · Source

Is it possible to hide a specific keyboard button? I have an EditText and on some devices its keyboard has smiley faces while on other devices it is missing. I want to hide it on all devices.

Below is the XML for my EditText:

android:id="@+id/text_editor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignWithParentIfMissing="true"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/send_side"
android:hint="Enter your text"
android:imeOptions="actionSend|flagNoEnterAction"
android:inputType="textLongMessage|textAutoCorrect|textCapSentences|textMultiLine"
android:maxLength="1000"
android:maxLines="3"
android:nextFocusRight="@+id/send_button"
android:padding="12dp"
android:textSize="13sp"

Is this possible?

Answer

Scorpio picture Scorpio · May 9, 2014

I found something in "Disabling smiley key on keyboards with the stock messaging app in ICS".

You need to remove the textLongMessage option from the inputType.

You will still have the ":-)" button on most keyboards, but not the emoji.