我制作了一个相机应用程序并将图像保存在 DCIM/Yogyakarta,但我无法打开该目录。它只能在 DCIM/ 中打开。
谁能告诉我为什么我无法打开目录,以及如何修复它?
public final class FroyoAlbumDirFactory extends AlbumStorageDirFactory {
@Override
public File getAlbumStorageDir(String albumName) {
// TODO Auto-generated method stub
return new File(
Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_DCIM
),
albumName
);
}
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mAlbumStorageDirFactory = new FroyoAlbumDirFactory();
Button buttonLoadImage = (Button) findViewById(R.id.buttonLoadPicture);
buttonLoadImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
storageDir = mAlbumStorageDirFactory.getAlbumStorageDir("Yogyakarta");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(storageDir),"*/*");
startActivityForResult(intent, RESULT_LOAD_IMAGE);
}
});