The best way to complete this is as follows ...
ImageGetter getter = new ImageGetter(){ public Drawable getDrawable(String source){ // source is the resource name Drawable d = null; Integer id = new Integer(0); id = getApplicationContext().getResources().getIdentifier(source, "drawable", "com.sampleproject"); d = getApplicationContext().getResources().getDrawable(id); if (d != null) d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight()); return d; } }; String imgString = this.getResources().getString(R.string.text_string) + " <img src=\"img_drawable_image\"/>"; ((TextView)findViewById(R.id.textview_id)).setText( Html.fromHtml(imgString, getter, null));
Debashis choudhury
source share