Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Intent startMain = new Intent(Intent.ACTION_MAIN);
- startMain.addCategory(Intent.CATEGORY_HOME);
- startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- startActivity(startMain);
- Intent sendIntent = new Intent();
- sendIntent.setAction(Intent.ACTION_SEND);
- sendIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
- sendIntent.setType("text/plain");
- startActivity(Intent.createChooser(sendIntent, "Share Text To..."));
- finish();
Add Comment
Please, Sign In to add comment