当前位置:编程学习 > wap >>

请教一个URL的路径问题

        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路径我直接显示到照片的盘符位置,为什么在手机上跑的时候却显示不出来呢???
      也不见报错呀,请各位大大指点一下。
       谢谢。 --------------------编程问答-------------------- 把图片拷到SD卡中再读吧同志。 --------------------编程问答--------------------
引用 1 楼  的回复:
把图片拷到SD卡中再读吧同志。

+++
补充:移动开发 ,  Android
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,