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) {
       // Log exception
       return null;
   }
}
arrow
arrow
    全站熱搜

    戮克 發表在 痞客邦 留言(0) 人氣()