I have a textview which holds an image and some text.
programmatically i have added the drawable image to the left side of text view
txtIDFav.setCompound
Embed the drawable in your text by using a SpannableString.
SpannableStringBuilder textspan = new SpannableStringBuilder(" " + yourText);
Drawable icon = getResources().getDrawable(R.drawable.fav_enabled);
// jump drawable to the text view's state (if it is a state drawable)
icon.setState(textView.getBackground().getState()); // match the background state
textspan.setSpan(new ImageSpan(icon, ImageSpan.ALIGN_BOTTOM), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
textView.setText(textspan);