我是安卓新手。我正在使用 Intent 显示全屏图像并在图像之间滑动。代码如下:
(我正在使用网格来显示图像,一旦我单击网格中的图像,我就会调用意图)
Gridview_sponsor = (GridView) findViewById(R.id.gridViewSponsor);
Gridview_sponsor
.setOnItemLongClickListener(new OnItemLongClickListener() {
public boolean onItemLongClick(AdapterView<?> arg0,
View arg1, int pos, long id) {
AlertDialog diaBox = AskOption(imagesName.get(pos)
.toString());
diaBox.show();
return true;
}
});
Gridview_sponsor.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1,
int position, long arg3) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(
Uri.parse("file://" + imagesName.get(position)),
"image/*");
startActivity(intent);
}
});
以前它工作正常。但是在卸载现有应用程序后它会停止交换。
在上面的代码imagesName.get(position)
中包含我分配给ACTION_VIEW
意图的图像路径。但它只是全屏显示图像并放大,缩小功能工作正常。但图像没有从该文件夹中滑动