0 youtube android channel youtube-channels
我想打开显示特定频道的YouTube应用,但这只会执行浏览器.
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)));
}
Run Code Online (Sandbox Code Playgroud)
我想表明这一点:

使用此代码将打开频道
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/channel/UCw7FqRl9XzrlB_D1vOg_Gyg")));
Run Code Online (Sandbox Code Playgroud)
对图书馆的研究称为YouTubeAndroidPlayerApi.这段代码完全符合您的要求.
Intent intent = YouTubeIntents.createUserIntent(this, channelName);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4955 次 |
| 最近记录: |