CodeKidX的Android存储选择器未显示我的文件

时间:2018-07-19 12:37:09

标签: android filepicker

我正在使用CodeKidX's Storage Chooser

我在MainActivity中设置的代码:

File path = this.getExternalFilesDir(null);
String pathStr = path.getPath();
chooserLoad = new StorageChooser.Builder()
            .withActivity(this)
            .withFragmentManager(getFragmentManager())
            .withMemoryBar(false)
            .allowCustomPath(true)
            .setType(StorageChooser.FILE_PICKER)
            .withPredefinedPath(pathStr)
            .build();
    // get path that the user has chosen
chooserLoad.setOnSelectListener(new StorageChooser.OnSelectListener() {
        @Override
        public void onSelect(String path) {
            File file = new File(path);
            webInterface.loadLocalExternalComplete(file);
        }
});

我正常称呼它

chooserLoad.show();

对话框出现。它告诉我多少内存是免费的,但没有文件显示。该目录中大约有5个文件。

然后单击对话框,程序将在紧急关闭时关闭。它说:

 Unfortunately AndroidHtmlTemplate has stopped

pathStr的值为/storage/emulated/0/Android/data/com.mywebsite.jon.androidhtmltemplate/files

我在做什么错了?

0 个答案:

没有答案