String uriPic = "http://lh3.ggpht.com/_s354WAuIc9E/" + "R_DpW4Rzj-I/AAAAAAAAAsc/Ox73tdxGLSw/logo.jpg";

/* new URL对象将网址传入 */ 

URL  imageUrl = new URL(uriPic);

/* 取得联机 */

HttpURLConnection conn = (HttpURLConnection) imageUrl .openConnection();

conn.connect();

/* 取得回传的InputStream */

InputStream is = conn.getInputStream();

/* 将InputStream变成Bitmap */

bitmap = BitmapFactory.decodeStream(is);

/* 关闭InputStream */

is.close();

相关文章:

  • 2022-12-23
  • 2021-07-06
  • 2021-09-06
  • 2021-11-17
  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2021-10-02
  • 2022-12-23
  • 2021-06-18
  • 2021-07-15
相关资源
相似解决方案