Can any one help me out how to use Html.ImageGetter to dispaly images using html image src tag ? and example or good tutorial
Here is the same as the accepted answer, but as a top level class (which is nicer if you want to use it from different places):
public class ResourceImageGetter implements ImageGetter {
private Context mContext;
public ResourceImageGetter(Context context) {
mContext = context;
}
@Override
public Drawable getDrawable(String source) {
Resources resources = mContext.getResources();
int identifier = resources.getIdentifier(source, "drawable", mContext.getPackageName());
Drawable res = resources.getDrawable(identifier);
res.setBounds(0, 0, res.getIntrinsicWidth(), res.getIntrinsicHeight());
return res;
}
}