Using Intent.ACTION_PICK for specific path

前端 未结 2 1349
梦毁少年i
梦毁少年i 2020-11-29 11:12

I am trying to use Android gallery to pick image. Launching gallery is easy for that purpose

Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
photo         


        
相关标签:
2条回答
  • 2020-11-29 11:26

    Why not ?

        Intent galleryIntent = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
    startActivity(galleryIntent)
    

    Good luck with..

    0 讨论(0)
  • 2020-11-29 11:33

    Sorry, no this is not possible.

    Also you are using this Intent protocol wrong. As per http://developer.android.com/reference/android/content/Intent.html#ACTION_PICK this protocol expects that you put the content: URI of the data set you want the picker to select from.

    That said, you should consider ACTION_PICK deprecated. The modern action is ACTION_GET_CONTENT which is much better supported; you will find support of ACTION_PICK spotty and inconsistent. Unfortunately, ACTION_GET_CONTENT also does not let you specify a directory.

    0 讨论(0)
提交回复
热议问题