当前位置: 动力学知识库 > 问答 > 编程问答 >

Android file picker and standard mime types

问题描述:

I want to start another activity so the user can pick a file to use in my app. (Specifically an audio file in this case.) I googled and found this:

http://android-er.blogspot.com/2011/03/pick-file-using-intentactiongetcontent.html.

Basically it creates an Intent with ACTION_GET_CONTENT and mime type "file/*". Questions:

  • Where is it documented, in the standard Android docs, that this will start a file chooser?
  • Can I depend on it? That is, is it part of Android or does it only work if the user has a certain file manager app installed.
  • Is this the best way to choose a file? I specifically want an audio file (mp3, etc) - one of the audio files on the SD card that the standard music player knows about, somehow. Should I look at ContentProviders?

网友答案:

http://developer.android.com/reference/android/content/Intent.html#ACTION_GET_CONTENT

分享给朋友:
您可能感兴趣的文章:
随机阅读: