从我的应用程序中搜索的Youtube应用程序的特定字符串 [英] Search a specific string in Youtube application from my app

查看:122
本文介绍了从我的应用程序中搜索的Youtube应用程序的特定字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个按钮,当我点击它,我想调用的Youtube应用程序和搜索predefined字符串(搜索字符串是不变的,我的意思是YouTube应用程序会自动显示的结果)。 我知道,搜索频道,我们把

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.

推荐答案

试试这个意图在YouTube上搜索:

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);

这篇关于从我的应用程序中搜索的Youtube应用程序的特定字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆