You can specify MediaStore Uri (which looks like content: // media / external / images / media / 42 ) instead of the absolute path in the file system.
Here is an example that takes a picture with a camera and calls the intent ACTION_SEND with this image. If the Google+ application is installed, the user will be able to publish the image that they received from the Google+ application.
public class MyActivity extends Activity {
...
static final int IMAGE_REQUEST = 0;
protected void pickImage() {
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, IMAGE_REQUEST);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == IMAGE_REQUEST) {
Uri uri = data.getData();
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/png");
intent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(i , "Share"));
}
}
}