Я делюсь одной фотографией на facebook, twitter, linkedin, picasa. Я могу поделиться текстом без каких-либо проблем. Может ли кто-нибудь объяснить на каком-нибудь примере, как поделиться одной фотографией. На данный момент я использую следующий код (Добавление действия Easy Share)
private ShareActionProvider mShareActionProvider;
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate menu resource file.
getMenuInflater().inflate(R.menu.main, menu);
MenuItem item = menu.findItem(R.id.menu_item_share);
mShareActionProvider = (ShareActionProvider) item.getActionProvider();
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
//Uri screenshotUri = Uri.fromFile(new File(getFilesDir(), ".jpg"));
Log.d("Storage dir ", "Getting the directory");
File f = FileUtils.getStorageDir();
Log.d("All Answers: ", f.getAbsolutePath());
sharingIntent.setType("image/png");
sharingIntent.putExtra(Intent.EXTRA_STREAM,f);
startActivity(Intent.createChooser(sharingIntent, "Share image using"));
// Set the share Intent
mShareActionProvider.setShareIntent(sharingIntent);
return true;
}
// Call to update the share intent
private void setShareIntent(Intent shareIntent) {
if (mShareActionProvider != null) {
mShareActionProvider.setShareIntent(shareIntent);
}
}
}
Заранее спасибо