When you press the button, you can run the code below.

 

startActivity(new Intent(Intent.ACTION_VIEW)
    .setData(Uri.parse("https://your_youtube_url_here")) // edit this url
    .setPackage("com.google.android.youtube"));	// do not edit

 

Edit the url in the second line

The setPackage on the third line doesn't need to be modified.

+ Recent posts