This code takes me to the browser, I have the vimeo application, how can it go to the vimeo application?
vimeo1.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);
}
});
EDITED
vimeo1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
try{
Intent browserIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse("http://player.vimeo.com/video/83178705"));
browserIntent.setPackage("com.vimeo.android.videoapp");
startActivity(browserIntent);
}
catch(Exception e){
// App is not Installed
//Navigate to Play Store or display message
}
}
});
We actually recently made a vimeo-deeplink-android library which should help you achieve exactly what you're looking to do.
You could include it with gradle:
compile 'com.vimeo.android.deeplink:vimeo-deeplink:1.0.0'
And then deeplink to your video with this method:
boolean handled = VimeoDeeplink.showVideoWithUri(Context context, String videoUri)
Where
videoUri
is equal to/videos/83178705
.Try this, set package name while Re-directing.
catch block will be called if no app is installed related to that package.
Edit
I have checked this and you were right its not working. I changed into my code. Now its opening Application but video is not running, I don't know why. Check this updated code.
With the official Vimeo app you can do this:
While this looks almost identical to your code, aside from lack of a
?
, on my Android phone it works fine (opens the Vimeo app).