Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在android中使用pinterest sdk共享图像?_Android_Pinterest - Fatal编程技术网

如何在android中使用pinterest sdk共享图像?

如何在android中使用pinterest sdk共享图像?,android,pinterest,Android,Pinterest,我已经在我的android studio项目中安装了Pinterest SDK,并在开发者帐户中注册了应用程序。我找不到可以在开发者控制台中共享图像的源。我如何使用SDK像facebook和twitter一样共享图像?我使用以下代码共享图像 private void shareOnPinterest() { String sharingText = "Sharing Text"; String imageUrl = "Image Url"; Str

我已经在我的android studio项目中安装了Pinterest SDK,并在开发者帐户中注册了应用程序。我找不到可以在开发者控制台中共享图像的源。我如何使用SDK像facebook和twitter一样共享图像?

我使用以下代码共享图像

private void shareOnPinterest() {
        String sharingText = "Sharing Text";
        String imageUrl = "Image Url";
        String description = "Description";
        String url = String.format(
                "https://www.pinterest.com/pin/create/button/?url=%s&media=%s&description=%s",
                urlEncode(sharingText), urlEncode(imageUrl), description);
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
        filterByPackageName(getActivity(), intent, getString("com.pinterest"));
        startActivity(intent);


    } else {
        Utils.displayDialog(getActivity(), getResources().getString(R.string.error_somthing_went_wrong));
    }
}
希望这对你有帮助