Reputation: 109
How can I send a link from the application that I'm doing now to a specific URL?
blah.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://player.vimeo.com/video/83178705?"));
startActivity(browserIntent);
}
});
Upvotes: 1
Views: 319
Reputation: 333
If you wish to open the Vimeo URL in the Vimeo Android application, you can either do as you posted, or you can intent out to the Vimeo application with the correct intent data (a.k.a. deep linking). To help facilitate both of these intent types, you can use the vimeo-deeplink-android library.
For the above video https://www.vimeo.com/83178705 you have two options:
VimeoDeeplink.openUrl(getApplicationContext(), "https://www.vimeo.com/83178705");
VimeoDeeplink.showVideoWithUri(getApplicationContext(), "/videos/83178705");
For the latter request, you could re-write it as:
VimeoDeeplink.showVideoWithUri(getApplicationContext(), VimeoDeeplink.VIMEO_VIDEO_URI_PREFIX + "83178705");
These requests will all open the Vimeo Android application (if installed) and launch the video player.
Upvotes: 2