daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public Bitmap getBitmapfromUrl(String imageUrl) {
  2.         try {
  3.             URL url = new URL(imageUrl);
  4.             HttpURLConnection connection = (HttpURLConnection) url.openConnection();
  5.             connection.setDoInput(true);
  6.             connection.connect();
  7.             InputStream input = connection.getInputStream();
  8.             Bitmap bitmap = BitmapFactory.decodeStream(input);
  9.             return bitmap;
  10.         } catch (Exception e) {
  11.             e.printStackTrace();
  12.             return null;
  13.  
  14.         }
  15.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top