I'm using the EmojiCompat support library to have emoji in my app, and I would like to have those emojis directly in the strings.xml file (ex: <string name="string_name">Some text \uD83E\uDD96</string>)
This works well for devices API>23 but otherwise it crash
A/art: art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0xf0
A/art: art/runtime/check_jni.cc:65] string: 'Some text '
A/art: art/runtime/check_jni.cc:65] in call to NewStringUTF
A/art: art/runtime/check_jni.cc:65] from java.lang.String android.content.res.StringBlock.nativeGetString(long, int)
The only solution I have found is to get the emoji code in a java variable and put it at the end of my string (like the google sample) and it works on every version supported.
But I really want to put emoji code in the strings files and be able to do something like this :
emojiTextView.setText(getText(R.string.string_name));
Does anyone know how to achieve this ?
