Programmatically hide/disable emoticons on Android soft keyboard

android emoji keyboard programmatically
how to turn off emojis on android
android-edittext keyboard
android email keyboard
android number keyboard
remove emojis from samsung keyboard
android keyboard type
android restrict emoji

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"

I have to say I am new to Android and if this is not possible I would like to know why.

Thank you for your help.


I don't really understand why the question is downvoted. It is a valid question.

I have found something here.

You need to remove the textLongMessage option from the inputType.

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

Programmatically hide/disable emoticons on Android soft keyboard , I don't really understand why the question is downvoted. It is a valid question. I have found something here. You need to remove the textLongMessage option  Hide Disable Soft Keyboard in android on EditText selection programmatically.Do not show soft keypad in android app after clicking select pressed EditText.


(For completeness sake)

This solution is for people who need to have textview without the smiley on their soft keyboard. @Adrian's solution, to use email address type, works but it will show unnecessary '@' and '.com' buttons on your keyboard. I tried several combinations of InputType and the best solution IMHO is this:

mTextView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);

Original Keyboard:

Resulting keyboard:

How to disable emojis programmatically in Android, I want to hide emojis and auto suggestions from keyboard programmatically. if not thousands, of input method editors (a.k.a., soft keyboards) for Android. Sometimes, when developing any application in android, we need to hide keyboard at start-up screen if our screen holds editable views like EditText, Spinner etc which have focus on them. Until user touch on one of editable view, we need to hide keyboard. To hide soft keyboard, use following short of code in your application.


This worked for me on Android 4.4.2

android:inputType="textEmailAddress|textMultiLine"

Handle input method visibility, Autosizing TextViews · Downloadable fonts · Fonts in XML · Emoji shows or hides the input method (such as the on-screen keyboard) as appropriate. attached hardware keyboard, the soft input method does not appear. Note: Once the input method is visible, you should not programmatically hide it. In this video you will learn, how to close the Android soft keyboard in code by using the InputMethodManager class and it's hideSoftInputFromWindow method. Example code: https://codinginflow.com


From Petr Daña in a similar question... This enables autocomplete and disables all the smileys.

InputFilter filter = new InputFilter() {
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
    for (int i = start; i < end; i++) {
        int type = Character.getType(source.charAt(i));
        //System.out.println("Type : " + type);
        if (type == Character.SURROGATE || type == Character.OTHER_SYMBOL) {
            return "";
        }
    }
    return null;
    }
};

mMessageEditText.setFilters(new InputFilter[]{filter});

Refer to the complete answer post

Emoji Compatibility, Emoji support library helps keep Android devices up to date with the latest emoji. Animate drawable graphics · Reveal or hide a view using animation · Move a view Fonts programmatically section in the Downloadable Fonts documentation. The keyboard can also check the version of the EmojiCompat support library  Show Hide soft keyboard programmatically in Android Chintan Rathod – Android Tutorials – April 13, 2015 July 27, 2017 How can I show hide soft keyboard programmatically when user touches outside widget?


I tried @Adrian's solution, but it has "@" and ".com" keys. I just need a field that can take user's name. I got my solution by combining textVisiblePassword and textNoSuggestions. android:inputType="textVisiblePassword|textNoSuggestions

Hide the Soft Keyboard on an Android, You can disable the soft keyboard, whether it's a stock Android keyboard or a third-party Scroll to “Text Settings” and tap the soft keyboard you want to hide. to Chinese, swap to a numbered keyboard and even display myriad emoticons for  I want to hide the keyboard when user click Login button, in this case, this solution works better than imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0). because in landscape phone, the keyboard cover the Login button, and user have to hide the keyboard manually. – li2 Jun 12 '17 at 9:52


Disable emoji suggestions when using gesture typing, It worked for me to go into the Text Correction section of the Google Keyboard settings and then to Add-On Dictionaries. Emoji for English words said it was  This sad story ends with the ugly truth: to hide the Android keyboard, you will be required to provide 2 forms of identification: a Context and either a View or a Window. I have created a static utility method which can do the job VERY solidly, provided you call it from an Activity.


android-edittext - St4k, 122. views. Edittext's text overlapped by softkeyboard's scroll bar 17.3k. views. How to programmatically hide/disable emoticons on Android soft keyboard. Now, I have defined the Input Type for my EditText to be number only and have drawn up a pretty keypad for my user to use, however I also need to make sure the soft keyboard doesn't pop up for my user when they click on the EditText. I have tried hiding the keyboard through the manifest by adding. android:windowSoftInputMode="stateAlwaysHidden"


Tip: Ban Emojis From Android and iOS, Apple simply lets you remove the emoji key, which is the approach I like the best: Navigate to Settings > General > Keyboard > Keyboards. Then,  Hide EditText soft keyboard on android programmatically on button click.Close EditText Smart pad keyboard on button click through coding.