tilak
tilak

Reputation: 4701

Android Pin It SDK - How to share local image?

I am trying to use Pinterest SDK . I have tried codes given in that link , its working fine for me. I need to share image from SD card. How to do it ?

I have tried with following code,

 pinIt = new PinItButton(this);
 pinIt.setImageUri(Uri.parse("/mnt/sdcard/EREADER/97890352465398/OEBPS/Cover.jpg"));
pinIt.setDescription("A place kitten!");
RelativeLayout _relLayout = (RelativeLayout)findViewById(R.id.layoutRelative);
pinIt.setDescription("A place kitten!");
_relLayout.addView(pinIt);

it gives me error like

imageUrl and/or imageUri cannot be null! Did you call setImageUrl(String) or setImageUri(Uri)?

Upvotes: 1

Views: 1197

Answers (1)

Longerian
Longerian

Reputation: 723

try this Uri.fromFile(new File("/mnt/sdcard/EREADER/97890352465398/OEBPS/Cover.jpg"));

Upvotes: 0

Related Questions