android - AndroidManifest.xml application/intent-filter 元素可以包含一个值吗?

标签 android android-intent android-manifest

Google 开发人员文档位于 http://developer.android.com/training/sync-adapters/creating-sync-adapter.html#DeclareSyncAdapterManifest在 list 中给出这个服务声明的例子:

<service
    android:name="com.example.android.datasync.SyncService"
    android:exported="true"
    android:process=":sync">
    <intent-filter>com.example.android.datasync.provider
        <action android:name="android.content.SyncAdapter"/>
    </intent-filter>
    <meta-data android:name="android.content.SyncAdapter"
               android:resource="@xml/syncadapter" />
</service>  

重申一下,上面的 XML 是由 Google 在他们自己的 Android 开发人员文档中编写的,位于上面的链接中。

注意 intent-filter 元素的值:com.example.android.datasync.provider。位于 http://developer.android.com/guide/topics/manifest/intent-filter-element.html 的 intent-filter 开发人员文档没有说它是有效的,也没有说如果存在该值将如何使用。

intent-filter 有一个值是否有效?如果有效,那么该值将用于什么?

如果它无效,那么 Google 写这篇文章的 Intent 是什么?

最佳答案

这看起来像是一个错字。从来没有见过这样的东西,这没有意义。此外,在以下文本中从未引用该文本。

但是,如果你在页面中搜索它,你会注意到这是关于“权威”的东西,但我又一次不知道为什么这样写。

通常 intent-filters 只有一个或多个触发服务 onReceive 的操作。

关于android - AndroidManifest.xml application/intent-filter 元素可以包含一个值吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22094655/

相关文章:

android - 如何使用 gradle kotlin dsl 设置单元测试 jvmargs

android - 无需安装 BarCode Scanner 即可集成 ZXing 二维码扫描器

java - webView帮助-错误页面INTERNET WebView

java - 使用 Proguard 时 Dropbox sync api 不工作

Scrollview 中的 Android Google Maps v2 在某些设备上显示灰色图 block

java - 安卓。从拨号器启动应用程序

android - 蓝牙配对 - 如何显示简单的取消/配对对话框?

安卓:如何将我的普通安卓应用程序转换为安卓启动器?

android - 如何让我的 Android 应用程序在后台保持 Activity 状态以进行 24/7 连续传感器数据收集

Android:禁用平板电脑的应用程序