Android google plus integration in my Android app gives android.content.ActivityNotFoundException

强颜欢笑 提交于 2019-12-11 20:36:24

问题


I want to share text and images on google plus like facebook and twitter but when I integrate google plus in my Android app and run it it gives exception:

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND typ=text/plain pkg=com.google.android.apps.plus

I follow the https://developers.google.com/+/mobile/android/getting-started guide lines.


回答1:


You need to Add that Activity to AndroidManifiest.xml file... If this doesn't solve your problem update the question with stacktrace and AndroidManifiest.xml file




回答2:


To share on Google+, you have two options:

  1. Programmatic sharing through App Activities. This is limited, though, as you cannot share text and images, but only a URL and action. The steps for this can be found at https://developers.google.com/+/mobile/android/app-activities.

  2. You can enable a user-initiated share with an Interactive Post. For these, you can prefill the text of the post by setting the setText parameter. You cannot share a photo directly, but you can set an image in the schema markup of the page so that it is included in the snippet of the share. You can learn about adding the share button at https://developers.google.com/+/mobile/android/share#adding_interactive_posts. And for information on the setText parameter, check out https://developer.android.com/reference/com/google/android/gms/plus/PlusShare.Builder.html#setText(java.lang.CharSequence)



来源:https://stackoverflow.com/questions/16355577/android-google-plus-integration-in-my-android-app-gives-android-content-activity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!