Created
January 26, 2017 17:31
-
-
Save menuka94/6cc5f880b126b973d43f96f825663e00 to your computer and use it in GitHub Desktop.
Android Intents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Executed in an Activity, so 'this' is the context | |
Intent intent = new Intent(this, NumbersActivity.class); | |
startActivity(intent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the text message with a string | |
Intent intent = new Intent(Intent.ACTION_SENDTO); | |
intent.setData(Uri.parse("mailto:")); | |
intent.putExtra(Intent.EXTRA_SUBJECT, "Just Java order for " + name); | |
intent.putExtra(Intent.EXTRA_TEXT, priceMessage); | |
// Verify that the intent will resolve properly | |
if(sendIntent.resolveActivity(getPackageManager()) != null){ | |
startActivity(intent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment