androidyoutubeyoutube-channels

Open Youtube Channel calling YouTube App (Android)


I want to open YouTube App showing an specific channel, but this only execute the browser.

try 
        {
            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(Uri.parse("http://www.youtube.com/"+channel));
            startActivity(intent);
        }
        catch (Exception e) 
        {
            startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("http://www.youtube.com/"+channel)));         
        }

I want to show this:

enter image description here


Solution

  • Do research on library called YouTubeAndroidPlayerApi. This piece of code does exactly what you want.

    Intent intent = YouTubeIntents.createUserIntent(this, channelName);
    startActivity(intent);