1

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

Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
tilak
  • 4,589
  • 6
  • 34
  • 45
  • 1
    a better practice is not to use hard coded SD card path. BTW, are you sure the image is put under `sdcard/EREADER/97890352465398/OEBPS/Cover.jpg` ? Please do check the file exists or not in your code before you assign it. – dumbfingers Jul 10 '13 at 11:05
  • just for the testing purpose it is hard coded. File is there in the SD card. – tilak Jul 10 '13 at 11:13

1 Answers1

0

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

Longerian
  • 723
  • 5
  • 13