Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search a specific string in Youtube application from my app

I have a button that when i tap on it i want to invoke Youtube app and search for predefined string(the search string is constant, i mean that Youtube app will display automatically the results). I know that for searching a channel, 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.

like image 719
androniennn Avatar asked Mar 25 '12 13:03

androniennn


1 Answers

try this Intent For 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);
like image 165
ρяσѕρєя K Avatar answered Oct 19 '22 22:10

ρяσѕρєя K