Show Emoji Keyboard On Android?

对着背影说爱祢 提交于 2019-12-08 03:06:24

问题


so I am building an Android app. I have used a custom emojicon pack that comes with emojis that look like the iOS ones. However, I've noticed that KitKat comes with native emoji support, so I want show that to users instead of my custom window if they have KitKat. How do I show a certain keyboard window, without changing the imeOptions?

I tried mEditText.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_PICTSYMBOLS)), but that didn't seem to do the trick


回答1:


put this properties in your edittext

 android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
 android:imeOptions="actionSend|flagNoEnterAction"

check the android stock sms app source

https://raw.github.com/android/platform_packages_apps_mms/master/res/layout/compose_message_activity.xml

this work with swiftkey and google keyboard




回答2:


find the EmojiEverywhere which will help to implement emoji. Emoji in TextView, EditText for Android (like Android KitKat Emoji Keyboard)



来源:https://stackoverflow.com/questions/22418714/show-emoji-keyboard-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!