- 語法:
-
<queries> <package android:name="string" /> <intent> ... </intent> <provider android:authorities="list" /> ... </queries>
- 包含於:
<manifest>
- 說明:
指定應用程式要與另外哪一組應用程式進行互動。已指定這些其他應用程式 依套件名稱、意圖 簽章或供應商授權,如 以下各節
注意:部分套件會自動處於可見狀態。您的 應用程式隨時可以在對其他已安裝應用程式的查詢中瀏覽這些套件。如要查看其他套件,請使用
<queries>
元素宣告應用程式需要提高套件瀏覽權限。進一步瞭解如何在以下項目中使用
<queries>
元素: 在 Android 上篩選套件瀏覽權限。- 子元素:
- 導入版本:
- API 級別 30
- 另請參閱:
- 在 Android 上篩選套件瀏覽權限
<查詢>
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# <queries\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cqueries\u003e\n \u003cpackage android:name=\"string\" /\u003e\n \u003cintent\u003e\n ...\n \u003c/intent\u003e\n \u003cprovider android:authorities=\"list\" /\u003e\n ...\n \u003c/queries\u003e\n ```\n\ncontained in:\n: [\u003cmanifest\u003e](/guide/topics/manifest/manifest-element)\n\ndescription:\n\n: Specifies the set of other apps that an app\n intends to interact with. These other apps are specified\n [by package name](#package), [by intent\n signature](#intent), or [by provider authority](#provider), as described in\n the following sections on this page.\n\n **Note:** Some packages are\n [visible automatically](/training/package-visibility/automatic). Your\n app always sees these packages in its queries for other installed apps. To\n view other packages, declare your app's need for increased package visibility\n using the `\u003cqueries\u003e` element.\n\n Learn more about how to use the `\u003cqueries\u003e` element in\n [Package visibility filtering on Android](/training/package-visibility).\n\nchild elements:\n:\n\n `\u003cpackage\u003e`\n\n : Specifies a single app that your app intends to access. This other\n app might integrate with your app, or your app might use services that the\n other app provides.\n\n attributes:\n\n `android:name`\n : **Required.** Specifies the package name of the other app.\n\n `\u003cintent\u003e`\n\n : Specifies an [intent filter\n signature](/training/basics/intents/filters). Your app can discover other apps that have matching\n [`\u003cintent-filter\u003e`](/guide/topics/manifest/intent-filter-element)\n elements.\n\n **Note:** There are some restrictions on the\n options that you can include in this `\u003cintent\u003e` element,\n compared to a typical intent filter signature. Learn more about these\n restrictions in [Packages\n that match an intent filter signature](/training/package-visibility/declaring#intent-filter-signature).\n\n `\u003cprovider\u003e`\n\n : Specifies one or more\n [content\n provider authorities](/guide/topics/providers/content-provider-basics#ContentURIs). Your app can discover other apps whose content\n providers use the specified authorities.\n\n **Note:** There are some restrictions on the\n options that you can include in this `\u003cprovider\u003e` element,\n compared to a typical\n [`\u003cprovider\u003e`](/guide/topics/manifest/provider-element)\n manifest element. Usually, you only specify the\n `android:authorities` attribute.\n\nintroduced in:\n: API level 30\n\nsee also:\n: [Package visibility filtering on Android](/training/package-visibility)"]]