Intent.ACTION_PICK behaves differently

前端 未结 2 1486
鱼传尺愫
鱼传尺愫 2021-01-26 13:28

I am using following code to pick an image from the gallery. When I test it with Samsung Galaxy S4, it directly goes to Gallery that is what I want actually.

BUT, when

2条回答
  •  甜味超标
    2021-01-26 13:48

    when I test my code on LG Optimus II device, it shows a dialog gives an option to choose either Gallery or Picture

    That is because there are two activities on that device that support ACTION_PICK of image/* files. There can be zero to N such activities, depending on what apps are on the device. This will include both pre-installed apps and apps that the user installed themselves. These will range from local file managers to general cloud providers (e.g., Dropbox) to image-specific apps (e.g., Instagram).

    In other words, it adds one more layer which I do not want.

    Then do not use ACTION_PICK. You are delegating to a third-party app; it is up to the user, not you, what third-party app the user wishes to use.

提交回复
热议问题