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============
翻译得不错,不过感觉还是有点和汉语的表达方式不一样。
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。