2011-04-12 74 views
2

我已經檢索到的圖像 的URI但是當我使用查看圖像中的android

startActivity(新意圖(Intent.ACTION_VIEW,mediaUri));

圖像在圖像查看器中查看,但我也可以看到其他圖庫圖像。

如何避免這種情況。

我只想要在圖像查看器中打開單個圖像。

回答

1

這可能會幫助你

Intent i = new Intent(android.content.Intent.ACTION_VIEW); 
i.setDataAndType(Uri.parse("file:///sdcard/path/to/myfile.png"),"image/png"); 
startActivity(i);