使用Intent从Android应用程序共享Pinterest

时间:2017-06-01 17:24:22

标签: android android-intent pinterest

使用Intent从Android应用程序分享Pinterest功能无效,有人可以帮我这个吗?

Uri bmpUri = Uri.fromFile(imageFileToShare)
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra("com.pinterest.EXTRA_DESCRIPTION", "Messagessssssssss");
shareIntent.putExtra(Intent.EXTRA_STREAM, bmpUri);
shareIntent.setType("image/*");
startActivity(Intent.createChooser(shareIntent, "Share Image"));

1 个答案:

答案 0 :(得分:1)

试试这个,但你应该测试Pinterest是否已经安装在用户的设备中。

File imageFileToShare = new File(orgimagefilePath);

Uri uri = Uri.fromFile(imageFileToShare);

Intent sharePintrestIntent = new Intent(Intent.ACTION_SEND);
sharePintrestIntent.setPackage("com.pinterest");
sharePintrestIntent.putExtra("com.pinterest.EXTRA_DESCRIPTION", text);
sharePintrestIntent.putExtra(Intent.EXTRA_STREAM, uri);
sharePintrestIntent.setType("image/*");
startActivityForResult(sharePintrestIntent, PINTEREST);

source