机器人的YouTube:共享YouTube视频到我的应用程序? [英] android youtube: share a youtube video TO my app?

查看:163
本文介绍了机器人的YouTube:共享YouTube视频到我的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在为平板电脑内置的YouTube应用程序有一个共享的选项。例如:我在观看YouTube应用程序的视频,然后单击按钮为共享。蓝牙,G​​ooglemail电子邮件,和Dropbox出现我。 我不知道我怎么能列出我的应用程序有?其中意向滤波器我的应用程序有哪些?如何我获得视频网址呢? 任何想法? 谢谢你。

The built in YouTube App for tablets has a sharing-option. For example: I watch a video in the YouTube app and click the button to share. Bluetooth, Googlemail, and Dropbox appear for me. I wonder how i can list my app there? Which intent-filter has my app to have? How do i get the video url then? Any idea? Thanks.

推荐答案

这为我工作。 加入这个意图过滤器到您的清单文件,使您的应用程序出现在YouTube的应用程序的份额列表中显示。

This worked for me. Add this intent filter to your manifest file to make your application appear in the share list of the youtube application.

<intent-filter>
   <action android:name="android.intent.action.SEND" />
   <category android:name="android.intent.category.DEFAULT" />              
   <data android:host="www.youtube.com" android:mimeType="text/*" />
</intent-filter>

然后检索它在你的活动,用这个:

Then to retrieve it in your activity, use this :

Bundle extras = getIntent().getExtras();
 String value1 = extras.getString(Intent.EXTRA_TEXT);

在这里,您们!

Here you are!

这篇关于机器人的YouTube:共享YouTube视频到我的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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