3

I have asked what is the code that sends a link from the application that I'm making to the vimeo application; it opens vimeo application but not the video specified in the link, does anybody knows how?

vimeo.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View arg0) {
          try{
              Intent browserIntent = null;
              PackageManager pmi = getPackageManager();
              browserIntent =     pmi.getLaunchIntentForPackage("com.vimeo.android.videoapp");
                   browserIntent.setAction(Intent.ACTION_VIEW);
                   browserIntent.setData(Uri.parse("http://player.vimeo.com/video/83178705"));
                   startActivity(browserIntent);                     
                }
                catch(Exception e){
                    Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://player.vimeo.com/video/83178705"));
                    startActivity(browserIntent);
                }
            }
      });
Alfie Hanssen
  • 16,964
  • 12
  • 68
  • 74
Roa
  • 109
  • 7
  • What happened when clicking the button ? Really it doesn't go to this link http://player.vimeo.com/video/83178705 ? – Vinoth Vino Mar 07 '16 at 00:59
  • The link was wrong, I put the right one and I didn't select anything! – Roa Mar 07 '16 at 01:04
  • Ok, I removed the 7th line and it goes by the browser, that's the second option, not the first :( – Roa Mar 07 '16 at 01:18
  • You want your link to open in vimeo app right ? but unfortunately it doesn't opens with your link ? – Vinoth Vino Mar 07 '16 at 01:20
  • When I tick on the link, it takes me to the vimeo application, (not the browser) but not to this link http://player.vimeo.com/video/83178705 – Roa Mar 07 '16 at 01:22
  • Do you want to open it in browser with that link ? or in vimeo app with your link ? – Vinoth Vino Mar 07 '16 at 01:23
  • No, first thing, player.vimeo.com/video/83178705 opens in the vimo application, if I don't have the vimeo application, it opens player.vimeo.com/video/83178705 on the browser. – Roa Mar 07 '16 at 01:26
  • Okay,Now is it not opening in vimeo app (with your link) ? – Vinoth Vino Mar 07 '16 at 01:27
  • No it's not, it goes to the browser., just in case, I have the application from https://play.google.com/store/apps/details?id=com.vimeo.android.videoapp – Roa Mar 07 '16 at 01:30
  • Ok, give me sometime. – Roa Mar 07 '16 at 02:11
  • Take your time... If it's helpful to you then accept and upvote my answer... – Vinoth Vino Mar 07 '16 at 02:18

2 Answers2

2

I answered your other question with this solution. But I believe it will fix this issue as well since our vimeo-deeplink library accommodates opening our specific application.

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.

Community
  • 1
  • 1
Kyle Venn
  • 4,597
  • 27
  • 41
1

By doing this below, it will reset all your app preference

Go to Settings->Apps, choose from menu Reset app preferences and confirm Reset apps.

After that, choose it in Settings->Apps and press Clear defaults button for vimeo app

Now try to open that video link(vimeo link) again. Now it'll ask you to select which app to use. Then select your vimeo app as default

Vinoth Vino
  • 9,166
  • 3
  • 66
  • 70