How to display all YouTube videos from specific ch

2020-08-04 07:03发布

问题:

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);
    }