I want to share Text + Image together using ACTION_SEND in android, I am using below code, I can share only Image but i can not share Text with it,
private Uri imageUri;
private Intent intent;
imageUri = Uri.parse("android.resource://" + getPackageName()+ "/drawable/" + "ic_launcher");
intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, "Hello");
intent.putExtra(Intent.EXTRA_STREAM, imageUri);
intent.setType("image/*");
startActivity(intent);
Any help on this ?
By accident(the text message part, I had given up on that), I noticed that when I chose Messages App to handle the request, the Message App would open with the text from Intent.EXTRA_SUBJECT plus the image ready to send, I hope it helps.
It is possibly because the sharing app (FB, twitter, etc) may not have permissions to read the image.
Google's document says:
http://developer.android.com/training/sharing/send.html
I am not sure the sharing apps have permissions to read an image in the bundle of our apps. But my files saved in
cannot be read. As suggested in the above link, we may consider to store images in the MediaStore, where the sharing apps have permissions to read.
Update1: The following is working code to share image with text in Android 4.4.
The side effect is we add an image in the MediaStore.
try using this code.I am uploading ic_launcher from drawable.you can change this with your file from gallary or bitmap.
please have a look on this code worked for me to share an text and image together
Don't forget to give WRITE_EXTERNAL_STORAGE Permission
also in facebook it can only share the image because facebook is not allowing to share the text via intent
I have been looking for solution of this question for a while and found this one up and running, hope it helps.