Android Pin It SDK - How to share local image?

1.1k views Asked by At

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)?

1

There are 1 answers

0
Longerian On

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