Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
- try
- {
- Download(URL); //download picture to SD card/Download
- final int THUMBNAIL_SIZE = 64;
- FileInputStream fis = new FileInputStream(Environment.getExternalStorageDirectory() + "/Download/", filename);
- Bitmap imageBitmap = BitmapFactory.decodeStream(fis);
- imageBitmap = Bitmap.createScaledBitmap(imageBitmap, THUMBNAIL_SIZE, THUMBNAIL_SIZE, false);
- imageview.setImageBitmap(imageBitmap);
- }
- catch(Exception ex) {
- }
- Bitmap photo = Bitmap.createScaledBitmap(BitmapFactory.decodeFile(myfile.getPath()),60,60,true);
- imageview.setImageBitmap(photo);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement