File file = new File(advInfo.strFullImagePath);
if( file != null && file.isFile() == true){
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), "image/*");
SNAdvView.this.getContext().startActivity(intent);}
}
调用系统程序打开指定的图片
该代码片段展示了如何使用Android平台打开一个指定路径的图片文件。通过创建File对象并验证其有效性后,利用Intent启动系统默认的图片查看应用来显示这张图片。

被折叠的 条评论
为什么被折叠?



