I have a piece of code which adds some image into an EditText using SpannableString as follow:
SpannableString ss = new SpannableString("Some random String in my application.");
Drawable d = getResources().getDrawable(R.drawable.emoticon_0001);
ImageSpan span = new ImageSpan(d, ImageSpan.ALIGN_BOTTOM);
ss.setSpan(span, startIndex, endIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
There is some index calculation in between that I did not include because they are not important. The code works fine. Here are some image of it:
Portrait and Landscape in non editing mode:
However, once I start editing in Landscape mode, the text behind image appears:
As most people know, the weird String represents the Unicode for the Emoticon in iPhone. Has anyone encountered this problem before?
EDIT: Tested with android:imeOptions="actionDone|flagNoExtractUi"
, does not work, word suggestion will cover up my EditText.