问题
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