Created
September 3, 2018 12:30
-
-
Save shubhamnikam/8ed35d3e2fddc766315e9e938c759ef1 to your computer and use it in GitHub Desktop.
Implicit Intent - Open Link
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
intentWebsite.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Uri uri = Uri.parse("http://www.google.com"); | |
Intent intent = new Intent(Intent.ACTION_VIEW, uri); | |
if (intent.resolveActivity(getPackageManager()) != null) { | |
startActivity(intent); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment