我正在尝试在 google+ 上分享我的内容。这是我正在关注的教程
这是给我问题的部分。
Intent shareIntent = ShareCompat.IntentBuilder.from(MyActivity.this)
.setType("text/plain")
.setText("Welcome to the Google+ platform. https://developers.google.com/+")
.getIntent()
.setPackage("myPakageName");
这是日志
09-09 08:05:10.510: W/dalvikvm(716): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
09-09 08:05:10.601: E/AndroidRuntime(716): FATAL EXCEPTION: main
09-09 08:05:10.601: E/AndroidRuntime(716): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND typ=text/plain flg=0x80000 pkg=(myPakageName) (has extras) }
09-09 08:05:10.601: E/AndroidRuntime(716): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1512)
09-09 08:05:10.601: E/AndroidRuntime(716): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
09-09 08:05:10.601: E/AndroidRuntime(716): at android.app.Activity.startActivityForResult(Activity.java:3190)
09-09 08:05:10.601: E/AndroidRuntime(716): at android.app.Activity.startActivity(Activity.java:3297)
09-09 08:05:10.601: E/AndroidRuntime(716): at com.trib.jax.mbhealth.MainMenu.shareGoogle(MainMenu.java:275)
09-09 08:05:10.601: E/AndroidRuntime(716): at com.trib.jax.mbhealth.MainMenu.access$5(MainMenu.java:267)
09-09 08:05:10.601: E/AndroidRuntime(716): at com.trib.jax.mbhealth.MainMenu$13.onClick(MainMenu.java:308)
09-09 08:05:10.601: E/AndroidRuntime(716): at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166)
09-09 08:05:10.601: E/AndroidRuntime(716): at android.os.Handler.dispatchMessage(Handler.java:99)
09-09 08:05:10.601: E/AndroidRuntime(716): at android.os.Looper.loop(Looper.java:137)
09-09 08:05:10.601: E/AndroidRuntime(716): at android.app.ActivityThread.main(ActivityThread.java:4424)
09-09 08:05:10.601: E/AndroidRuntime(716): at java.lang.reflect.Method.invokeNative(Native Method)
09-09 08:05:10.601: E/AndroidRuntime(716): at java.lang.reflect.Method.invoke(Method.java:511)
09-09 08:05:10.601: E/AndroidRuntime(716): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
09-09 08: