private void addImageBetweentext(Drawable drawable, EditText editText1) {
drawable .setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
int selectionCursor = editText1.getSelectionStart();
editText1.getText().insert(selectionCursor, ".");
selectionCursor = editText1.getSelectionStart();
SpannableStringBuilder builder = new SpannableStringBuilder(editText1.getText());
builder.setSpan(new ImageSpan(drawable), selectionCursor - ".".length(), selectionCursor,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
editText1.setText(builder);
editText1.setSelection(selectionCursor);
}