2017-06-01 66 views
0

Pinterest分享從Android應用程序使用意圖不工作,有人可以幫助我嗎?Pinterest分享從Android應用程序使用意圖

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

試試這個,但你應該測試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