Finding a specific string in a Youtube application from my application

I have a button which, when I click on it, I want to call the Youtube application and search for a predefined string (the search bar is constant, I mean that the Youtube application automatically displays the results). I know that for channel search we put

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.youtube.com/user/channel"))

But what about searching for a specific video (constant string)? Thank you for your help.

+5
source share
1 answer

try this intention to search on Youtube:

 Intent intent = new Intent(Intent.ACTION_SEARCH);
 intent.setPackage("com.google.android.youtube");
 intent.putExtra("query", "Android");
 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 startActivity(intent);
+20
source

All Articles