How To Share Image And Text On Pinterest Using Intent
I want to share image and text on pinterest using intent. Any ideas?
Solution 1:
You have to first check pintrest application is installed into device or not using this function.
privatebooleanappInstalledOrNot(String uri) {
PackageManager pm = getPackageManager();
boolean app_installed;
try {
pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
app_installed = true;
}
catch (PackageManager.NameNotFoundException e) {
app_installed = false;
}
return app_installed;
}
If this function returns you true than you can call this below line.
FileimageFileToShare=newFile(orgimagefilePath);
Uriuri= Uri.fromFile(imageFileToShare);
IntentsharePintrestIntent=newIntent(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);
This was work for me. please check it.
Post a Comment for "How To Share Image And Text On Pinterest Using Intent"