gpt4 book ai didi

android - 在 GooglePlus SDK 上使用 native 共享时, Activity 在没有 EXTRA_ACCOUNT 的情况下启动

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:15:54 25 4
gpt4 key购买 nike

我的应用程序中有 Google+ 连接,当我尝试使用 Person 对象获取用户信息时,一切正常。

但是当我按照说明使用共享对话框时 in the documentation ,我在 G+ 库中遇到了崩溃。

这是我为此使用的代码:

Intent shareIntent = new PlusShare.Builder(getActivity())
.setType("text/plain")
.setText(getString(R.string.application_sharing_default_share_with_friends))
.setContentUrl(Uri.parse(shareLink))
.getIntent();
startActivityForResult(shareIntent, 0);

当我运行它时,我得到的只是这个错误和崩溃:

11-05 11:30:51.093: E/AndroidRuntime(617): FATAL EXCEPTION: main
11-05 11:30:51.093: E/AndroidRuntime(617): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.apps.plus/com.google.android.apps.plus.phone.ShareActivity}: java.lang.IllegalStateException: Activity started without an EXTRA_ACCOUNT
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.ActivityThread.access$600(ActivityThread.java:130)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.os.Handler.dispatchMessage(Handler.java:99)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.os.Looper.loop(Looper.java:137)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.ActivityThread.main(ActivityThread.java:4745)
11-05 11:30:51.093: E/AndroidRuntime(617): at java.lang.reflect.Method.invokeNative(Native Method)
11-05 11:30:51.093: E/AndroidRuntime(617): at java.lang.reflect.Method.invoke(Method.java:511)
11-05 11:30:51.093: E/AndroidRuntime(617): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-05 11:30:51.093: E/AndroidRuntime(617): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-05 11:30:51.093: E/AndroidRuntime(617): at dalvik.system.NativeStart.main(Native Method)
11-05 11:30:51.093: E/AndroidRuntime(617): Caused by: java.lang.IllegalStateException: Activity started without an EXTRA_ACCOUNT
11-05 11:30:51.093: E/AndroidRuntime(617): at brz.onCreate(PG:169)
11-05 11:30:51.093: E/AndroidRuntime(617): at com.google.android.apps.plus.phone.PostActivity.onCreate(PG:77)
11-05 11:30:51.093: E/AndroidRuntime(617): at com.google.android.apps.plus.phone.ShareActivity.onCreate(PG:156)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.Activity.performCreate(Activity.java:5008)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
11-05 11:30:51.093: E/AndroidRuntime(617): ... 11 more

最佳答案

这是 Google+ 应用程序中的一个错误,已在今天发布的最新版本中修复:https://plus.google.com/101870761930221849874/posts/KohXe9pBGF6对于那个很抱歉。

关于android - 在 GooglePlus SDK 上使用 native 共享时, Activity 在没有 EXTRA_ACCOUNT 的情况下启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19785761/

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