I was trying to get HTML content from a website and displaying it in a Text View. But i am getting an error:
"Unable to decode stream: java.io.FileNotFoundException"
This is the logcat:
03-10 10:41:22.905: E/BitmapFactory(2994): Unable to decode stream: java.io.FileNotFoundException: /http:/www.mobileappscentre.co.uk/healthapp/wp-content/uploads/2013/11/tmt-instability-226x300.jpg: open failed: ENOENT (No such file or directory)
This is my code used for
Spanned htmlSpan = Html.fromHtml(display, new ImageGetter() {
@Override
public Drawable getDrawable(String source) {
String path = source;
Drawable bmp = Drawable.createFromPath(path);
bmp.setBounds(0, 0, bmp.getIntrinsicWidth(), bmp.getIntrinsicHeight());
Drawable bmp = null;
return bmp;
}
}, null);
blog.setText(htmlSpan);
When I Toast the file 'path' , I am getting correct URL.