0

I have to following problem. I want to share an image using intent chooser to the as many apps as possible. To achieve that I have two options:

  1. Save the image to MediaStore. But that means that image will show up in the gallery without user's granting it.

  2. Or share the image using using FileProvider. But if I use FileProvider some apps don't work and throw the following exception:

java.lang.IllegalStateException: Couldn't read row 0, col 0 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it. at android.database.CursorWindow.nativeGetLong(Native Method) at android.database.CursorWindow.getLong(CursorWindow.java:507) at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:75) at android.database.CursorWrapper.getLong(CursorWrapper.java:106) at ehz.a(PG:175) at duj.a(PG:540) at com.google.android.apps.photos.phone.SendContentActivity.onClick(PG:177) at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4998) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593) at dalvik.system.NativeStart.main(Native Method)

Working FileProvider would be perfect for me because with .nomedia option I can hide the image from Gallery and still share image to all the other apps.

Did anyone manage to solve this? Is there another option to share an image that can be accessed to all the other apps?

Thanks

4

1 回答 1

0

保存了问题。而不是我使用Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)和创建子目录的所有选项.nomedia并且它有效。

于 2013-11-22T11:19:41.430 回答