首页 > 代码库 > ANDROID开发文档翻译
ANDROID开发文档翻译
============问题描述============
麻烦谁能准确地翻译这几段话。
The way the system identifies the components that can respond to an intent is by comparing the intent received to the intent filters provided in the manifest file of other apps on the device.
When you declare an activity in your app‘s manifest, you can optionally include intent filters that declare the capabilities of the activity so it can respond to intents from other apps. You can declare an intent filter for your component by adding an <intent-filter> element as a child of the component‘s declaration element.
For example, if you‘ve built an email app with an activity for composing a new email, you can declare an intent filter to respond to "send" intents (in order to send a new email) like this:
============解决方案1============
系统识别能响应intent的components的方法是,将接收到的intent与设备上其它app的manifest文件中提供的intent过滤器作比较。
当你在你的app的manifest文件中声明一个activity时,你可以选择性地包含intent过滤器,这些过滤器声明了这个activity的兼容性,所以它可以响应从别的app接收到的intent。你可以为你的component声明一个intent过滤器,方法是在声明component标签的子标签处添加<intent-filter>。
举个例子,如果你作了一个email的app,这个app有一个写邮件的activity,你可以声明一个intent过滤器来响应“发送”intent(为了发送新邮件)像这样:
============解决方案2============
翻译得不错,不过感觉还是有点和汉语的表达方式不一样。
ANDROID开发文档翻译
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。