0

我的 SD 卡上有一系列图像路径,并将它们显示在列表中。我想将 onitemclick 与图像可视化相关联,而不是创建我自己的活动,我想知道是否存在在给定图像路径的情况下显示它的意图。

4

1 回答 1

1

此解决方案假定您具有图像的路径

Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(path)), "image/png");
startActivity(intent);
于 2012-08-29T16:35:12.700 回答