Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void shareTextWithChooser(String textToShare) {
- Intent shareIntent = new Intent(Intent.ACTION_SEND);
- shareIntent.setType("text/plain");
- shareIntent.putExtra(Intent.EXTRA_TEXT, textToShare);
- Intent openInChooser = Intent.createChooser(shareIntent, "Share with ...");
- startActivity(openInChooser);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement