ActivityNotFoundException在谷歌加 [英] ActivityNotFoundException In Google Plus

查看:196
本文介绍了ActivityNotFoundException在谷歌加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序想要分享图片在谷歌Plus和我读过关于谷歌加和API显示,我们可以通过媒体发布文件<一个href="https://developer.android.com/reference/com/google/android/gms/plus/PlusShare.Builder.html">PlusShare.Builder.而且我还搜查,计算器,但ditn't获取任何合适的回答。 我曾尝试与这些code是:

My Application Want to share Image on Google Plus And I have read About Google Plus And API shows that we can post media File using PlusShare.Builder. And I have Also Searched In stackoverflow but ditn't Get any Proper Answer. And I have Tried with These Code is :

case R.id.Share:
         if (mPlusClient.isConnected()) {
         Intent shareIntent = new PlusShare.Builder(this,mPlusClient)
         .setType("image/*")
         .setText("Risk Score")
         .addStream(Uri.fromFile(new File(Path)))
         .getIntent();
         startActivityForResult(shareIntent, REQ_START_SHARE);
         }

        break;

  case R.id.Share:

Intent shareIntent = ShareCompat.IntentBuilder.from(PlusActivity.this)
   .setText("This site has lots of great information about Android! http://www.android.com")
.setType("image/*").addStream(Uri.fromFile(new File(Path)))
.getIntent().setPackage("com.google.android.apps.plus");             
 startActivityForResult(shareIntent, REQ_START_SHARE);
        break;

 case R.id.Share:

         Intent shareIntent = new PlusShare.Builder(this,mPlusClient)
         .setType("image/*")
         .setText("Risk Score")
         .addStream(Uri.fromFile(new File(Path)))
         .getIntent();
         startActivityForResult(shareIntent, REQ_START_SHARE);

        break;

每一次我得到同样的问题。

And Every Time I am Getting Same Problem.

12-05 12:19:57.316: E/AndroidRuntime(4688): FATAL EXCEPTION: main
12-05 12:19:57.316: E/AndroidRuntime(4688): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND typ=image/* flg=0x80000 pkg=com.google.android.apps.plus (has extras) }
12-05 12:19:57.316: E/AndroidRuntime(4688):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1518)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1390)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at android.app.Activity.startActivityForResult(Activity.java:3204)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at com.winit.android.riskfactor.PlusActivity.onClick(PlusActivity.java:133)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at android.view.View.performClick(View.java:3517)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at android.view.View$PerformClick.run(View.java:14155)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at android.os.Handler.handleCallback(Handler.java:605)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at android.os.Handler.dispatchMessage(Handler.java:92)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at android.os.Looper.loop(Looper.java:154)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at android.app.ActivityThread.main(ActivityThread.java:4624)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at java.lang.reflect.Method.invokeNative(Native Method)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at java.lang.reflect.Method.invoke(Method.java:511)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
12-05 12:19:57.316: E/AndroidRuntime(4688):     at dalvik.system.NativeStart.main(Native Method)

和我看过这些问题又

<一个href="http://stackoverflow.com/questions/16849502/sending-json-data-to-google-plus">sending-json-data-to-google-plus

<一个href="http://stackoverflow.com/questions/16355577/android-google-plush-intregation-in-my-android-app-gives-android-content-activit">android-google-plush-intregation-in-my-android-app-gives-android-content-activit

<一个href="http://stackoverflow.com/questions/16849502/sending-json-data-to-google-plus">sending-json-data-to-google-plus

<一个href="http://stackoverflow.com/questions/12336293/failing-to-share-on-google-with-android">failing-to-share-on-google-with-android

<一个href="http://stackoverflow.com/questions/9865301/no-activity-found-to-handle-intent-causes-fc">no-activity-found-to-handle-intent-causes-fc

推荐答案

的Google+没有一个独立的写入API提供给普通开发者 - 发布到Google+,通过一个应用程序是打开Goog​​le+应用的唯一途径(preferably利用 PlusShare.Builder 返回的意图),所以如果谷歌,加上不是present那么它会给ActivityNotFoundException。

Google+ does not have an independent write API available to general developers - the only way to post to Google+ via an app is to open the Google+ app (preferably using the Intent returned by PlusShare.Builder) So If Google plus is not present then it will give ActivityNotFoundException.

这篇关于ActivityNotFoundException在谷歌加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆