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