How to display bitmap in edittext using input join

I am developing an emoji keyboard and want to print images in the watsapp editor. I tried it with a spannable string, but it only prints the text specified in the constructor. What do I need to do? My code is as follows:

Drawable d = getResources().getDrawable(watsapp1[j]); d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight()); ImageSpan span = new ImageSpan(d, ImageSpan.ALIGN_BASELINE); Log.i("",""+span); SpannableString ss = new SpannableString(" "); ss.setSpan(span, 0,1, Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //editT.setText(ss); MainActivity.ic.commitText(ss, 1); 
+4
source share

Source: https://habr.com/ru/post/1494203/


All Articles