Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // tai hinh anh ve --> bitmap
- public static Bitmap getBitmapFromURL(String src) {
- try {
- URL url = new URL(src);
- HttpURLConnection connection = (HttpURLConnection) url.openConnection();
- connection.setDoInput(true);
- connection.connect();
- InputStream input = connection.getInputStream();
- Bitmap myBitmap = BitmapFactory.decodeStream(input);
- return myBitmap;
- } catch (IOException e) {
- e.printStackTrace();
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement