Security Exception when trying to access a Picasa image on device running 4.2

后端 未结 2 707
孤街浪徒
孤街浪徒 2020-12-03 14:06

in my app i let the user select an image from the gallery and had no problems doing this pre 4.2 but now when I select an image that is synced from my google+ account which

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-03 15:04

    I had a similar problem implementing ACTION_SEND and ACTION_SEND_MULTIPLE in my app (also in Android 4.2.x). If I went to the gallery, selected one or more Picasa images, then chose "share", then chose my app from the picker, my app would throw the same SecurityException as above. Any attempt to use a query/load method from ContentResolver would throw.

    I also tried adding the GALLERY_PROVIDER permission, but it didn't help (also, I looked in Instagram's manifest; It doesn't have this permission listed).

    Eventually, on a whim, I took out android:launchMode="singleTask" from my entity, and low and behold, everything worked.

    I have no idea why a single-task app would be barred from sharing in this way. Bug? Feature?

提交回复
热议问题