请教一个URL的路径问题

adbquestion 2012-05-15 03:22:15
img01 = (ImageView)findViewById(R.id.img01);
String urlStr = "D:/workspace/May15_URL_Image/assets/pc.png";
try {
URL url = new URL(urlStr);
URLConnection urlConn = url.openConnection();
InputStream in = urlConn.getInputStream();
Bitmap bm = BitmapFactory.decodeStream(in);
img01.setImageBitmap(bm);
} catch (Exception e) {
e.printStackTrace();
}
这里的urlStr路径我直接显示到照片的盘符位置,为什么在手机上跑的时候却显示不出来呢???
也不见报错呀,请各位大大指点一下。
谢谢。
...全文
47 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
android_Y 2012-05-15
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]

把图片拷到SD卡中再读吧同志。
[/Quote]
+++
himi_ 2012-05-15
  • 打赏
  • 举报
回复
把图片拷到SD卡中再读吧同志。

80,493

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧