I try to download a picture from URL to SD card/Download. And I try to show its thumbnail in imageview. Now I had below code:
try {
Download(URL); //download picture to SD card/Download
File myfile = new File(Environment.getExternalStorageDirectory() + "/Download/", filename);
Drawable photo = null;
photo = Drawable.createFromPath(myfile.getPath());
imageview.setBackgroundDrawable(photo);
}
It show the original picture. But when the picture is large. The memory error occurs. So I want to show the smaller picture. How should I do to generate the thumbnail and show it? Or how to use the thumbnail generate by Android system?