Code is written as follows:
final Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("*/*");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(Intent.EXTRA_SUBJECT, subject.toString());
intent.putExtra(Intent.EXTRA_TEXT, text.toString());
intent.putExtra(Intent.EXTRA_STREAM, "file://" + path);
startActivityForResult(
Intent.createChooser(intent, title.toString()), REQUEST_CODE);
The results are as follows
- API 10 : work
- API 14 : error
Use this method to share photo with text. Call this method and pass argument nameofapp and imagepath. Name of app means like on which you want to share like gmail , facebook , twitter.
Use this like :-