I know that it is possible to launch YouTube app (if it's installed) on Android to watch a specific video. Can we do a similar thing for searching?
I mean I can use YouTube api to make a search but I don't want to do it, I just want to give search parameters to youtube app, so it can make the search for me. (So, instead of opening the web browser to show search results, I want to show the results in youtube app)
Is this possible?
Open the YouTube app. Tap Search . Enter a search term.
If you select your profile picture in the top-right corner of any YouTube page and select Settings, you'll get to the account settings page.
Try something like this:
Intent intent = new Intent(Intent.ACTION_SEARCH);
intent.setPackage("com.google.android.youtube");
intent.putExtra("query", "something");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
The "query", "something"
is your search query, for example:
intent.putExtra("query", "cats");
You can also use a link like this: https://www.youtube.com/results?search_query=madonna
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With