我想在 android 图库中显示一张照片,并能够滑动将其他照片扔到该文件夹中。
Intent intent = new Intent(Intent.ACTION_VIEW);
File f = new File(path);
intent.setDataAndType(Uri.parse("file://" + f.getAbsolutePath()), "image/*");
mContext.startActivity(intent);
这就是我现在的做法,但不会让我滑动文件夹中的其余图像。 我试过:
How to open one particular folder from gallery in android?
Built-in gallery in specific folder
没有任何运气。 如果有人有解决方案,我会很高兴。 谢谢!
最佳答案
试试这个
Intent i=new Intent();
i.setAction(Intent.ACTION_VIEW);
i.setDataAndType(Uri.fromFile(new File(path)), "image/*");
startActivity(i);
查看这些链接
How can I use Intent.ACTION_VIEW to view the contents of a folder?
Android ACTION_VIEW Multiple Images
Java and Android: How to open several files with an Intent?
如果这能解决您的问题。也检查一下
https://www.google.co.in/?gfe_rd=cr&ei=c5n9U6ruE7DO8gfXz4G4BA&gws_rd=ssl#q=view+like+gallery
同时检查 Gallery
小部件
关于Android 从文件夹中打开图库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25478828/