gpt4 book ai didi

android - 分享到 Pinterest 不适用于 Marshmallow

转载 作者:行者123 更新时间:2023-11-30 01:18:31 24 4
gpt4 key购买 nike

我正在尝试从本地存储共享 PNG 图像,目的是:

Intent intent = new Intent(Intent.ACTION_SEND, imageUri)
.putExtra(Intent.EXTRA_STREAM, imageUri)
.putExtra(Intent.EXTRA_TEXT, text)
.putExtra("com.pinterest.EXTRA_DESCRIPTION", "123")
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
.setType("image/png");
return Intent.createChooser(intent, "Share with");

它适用于 Facebook、Instagram 等。但对于 Pinterest,并且仅在 Android 6.0.1 上,我遇到了这个奇怪的异常:

  Caused by: 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:511)
at android.database.CursorWindow.getInt(CursorWindow.java:578)
at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java:69)
at android.database.CursorWrapper.getInt(CursorWrapper.java:122)
at com.pinterest.common.kit.utils.ImageUtils.getRotationForImage(SourceFile:231)
at com.pinterest.common.kit.utils.ImageUtils.rotateBitmapIfNeeded(SourceFile:201)
at com.pinterest.common.kit.utils.ImageUtils.imageFromUri(SourceFile:145)
at com.pinterest.activity.create.fragment.CreateBaseFragment.setImageUri(SourceFile:604)
at com.pinterest.activity.create.fragment.CreateBaseFragment.init(SourceFile:330)
at com.pinterest.activity.create.fragment.CreateBaseFragment.onCreateView(SourceFile:120)
at android.support.v4.app.Fragment.performCreateView(SourceFile:1974)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1067)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1252)
at android.support.v4.app.BackStackRecord.run(SourceFile:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(SourceFile:1617)
at android.support.v4.app.FragmentController.execPendingActions(SourceFile:339)
at android.support.v4.app.FragmentActivity.onStart(SourceFile:602)
at com.pinterest.kit.activity.SocialConnectActivity.onStart(SourceFile:111)
at com.pinterest.kit.activity.BaseActivity.onStart(SourceFile:90)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1237)
at android.app.Activity.performStart(Activity.java:6268)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
at android.app.ActivityThread.-wrap11(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

你能帮忙处理一下吗? Pinterest SDK 不是一个选项。

最佳答案

CommonsWare 的帮助下解决了通过使用 LegacyCompatFileProvider

关于android - 分享到 Pinterest 不适用于 Marshmallow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37479267/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com