Created
September 3, 2018 12:32
-
-
Save shubhamnikam/7afae3e5e1adeac40bf768eb569c5ba2 to your computer and use it in GitHub Desktop.
Implicit Intent - Share
This file contains hidden or 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
intentShare.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Intent intent = new Intent(Intent.ACTION_SEND); | |
intent.setType("text/plain"); | |
String message = "hey there..."; | |
intent.putExtra(Intent.EXTRA_TEXT, message); | |
if (intent.resolveActivity(getPackageManager()) != null) { | |
startActivity(intent.createChooser(intent, "Share Using :")); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment