How I display all YouTube videos from specific channel in Android app .I m using Android studio to develop Android App...and New video from channel automatically display in Android app.... Please Help Me
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
String youtubeURL = "https://www.youtube.com/user/androiddevelopers";
Intent youtubeIntent=null;
try {
youtubeIntent=new Intent(Intent.ACTION_VIEW);
youtubeIntent.setPackage("com.google.android.youtube");
youtubeIntent.setData(Uri.parse(youtubeURL ));
startActivity(youtubeIntent);
} catch (ActivityNotFoundException e) { // If youtube app not available then using browser it should open
youtubeIntent= new Intent(Intent.ACTION_VIEW);
youtubeIntent.setData(Uri.parse(youtubeURL ));
startActivity(youtubeIntent);
}