Showing user a particular folder in sd card and allow to select file [closed]

依然范特西╮ 提交于 2019-12-13 03:49:28

问题


In my game, I save files(.xml) to a folder in sd card when user save a particular mode. Now while loading saved files, I need to show user all saved files. I want to show them as you do while selecting images from gallery as below

     Intent intent = new Intent();
     intent.setType("image/*");
     intent.setAction(Intent.ACTION_PICK);
     startActivity(intent);

Can I do something like this? I have searched, but did not find. Help would be appreciated.

Note : I can do so by fetching all saved files in my app listView and show to user but I would like to give 2nd priority for that.

Thanks


回答1:


There is no built in system app for this. The theory is to not expose the users to the file system. If you do want to do it and not code your own implementation then you can use OpenIntents and there OI File Manager there is of course the proboelm that the user may not have the app installed so you have to be prepared to prompt them to install it. Your user may not apreciate this.

I do use this approach in my app IpBike. I take my users to have some brains and be able to cope with a file system, and file import and export is an intergral feature.



来源:https://stackoverflow.com/questions/11896386/showing-user-a-particular-folder-in-sd-card-and-allow-to-select-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!