一、打开某个目录代码,在androidR上可以用,旧的方法在androidR上面不生效,不能到指定目录。
public void openAssignFolder(String dir)//openAssignFolder("CameraPhotos");
{
Uri uri =
Uri.parse("content://com.android.externalstorage.documents/document/primary:"+dir);
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.setType("*/*");
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, uri);
startActivity(intent);
//startActivityForResult(intent, 1);
}
二、参考文章