I have been trying for the last 3 days to show a graphical custom emoticon in the default android message view. I have successfully shown my custom emoticons in place of keys. Now the problem is that I am trying to show a drawable in spanable string builder. But the drawable just does not appear on the keyboard. Here is the code so far:
SpannableString ss = new SpannableString(" ");
Drawable d = getResources().getDrawable(R.drawable.a);
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
// ImageSpan span = new ImageSpan(d, ImageSpan.ALIGN_BASELINE);
ImageSpan span = new ImageSpan(d);
// ss.setSpan(span, 0, 1, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
mComposing.append(":");
mComposing.setSpan(new ImageSpan(d), 0,1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
getCurrentInputConnection().commitText(mComposing, 1);
I have tried different methods to somehow fit the drawable but it just wont show on the default message view of android. Any help would be highly appreciated.