打开图片无缩略图错误

1.通过intent打开,显示无缩略图,

                Item item= (Item) parent.getItemAtPosition(position);
                File file=new File(item.address);
                Log.i(TAG, "onItemLongClick: "+item.address);
                if(item.name.contains("png")){

                    Intent intent = new Intent("android.intent.action.VIEW");
                    intent.addCategory("android.intent.category.DEFAULT");
                    intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK);
                    Uri uri = Uri.fromFile(new File(item.address));
                    Log.d(TAG, "onItemLongClick: **"+uri);
                    intent.setDataAndType (uri, "image/*");
                    startActivity(intent);
}
onItemLongClick: /storage/sdcard1/AA/17-02-28 13-42-40 2266-01端 轮径单.png
onItemLongClick: **file:///storage/sdcard1/AA/17-02-28%2013-42-40%202266-01%E7%AB%AF%20%E8%BD%AE%E5%BE%84%E5%8D%95.png

2.然后点击上传,报错,但是该路径下是存在这个图片的

java.io.FileNotFoundException: /storage/sdcard1/AA/17-02-28 13-42-40 2266-01端 轮径单.png: open failed: ENOENT (No such file or directory)

 

posted @ 2017-02-28 13:50  咖喱不见不散啊  阅读(221)  评论(0编辑  收藏  举报