code: public static Intent newPlayYouTubeVideoIntent(String videoId) {
          try {
              return new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:" + videoId));
          } catch (ActivityNotFoundException ex) {
              return new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=" + videoId));
          }
      }
docs: Open a YouTube video. If the app is not installed, it opens it in the browser
  
  @param videoId The video ID
  
  @return the intent