Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 SD 卡上有一系列图像路径,并将它们显示在列表中。我想将 onitemclick 与图像可视化相关联,而不是创建我自己的活动,我想知道是否存在在给定图像路径的情况下显示它的意图。
此解决方案假定您具有图像的路径:
Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(new File(path)), "image/png"); startActivity(intent);