- 語法:
<permission-group android:description="string resource" android:icon="drawable resource" android:label="string resource" android:name="string" />
- 包含於:
<manifest>
- 說明:
- 宣告相關權限之邏輯群組的名稱。個人
權限會透過
permissionGroup
屬性加入群組<permission>
元素。群組成員全部顯示在使用者介面中。這個元素不會宣告權限本身,只會宣告內部可放置權限的類別。 如要瞭解如何宣告權限並將其指派給群組,請參閱
<permission>
元素。 - 屬性:
android:description
- 使用者可理解的群組說明文字。文字是
比標籤長得更詳細此屬性必須是
並設為字串資源的參照。與「
label
」不同 屬性,則不能是原始字串。 android:icon
- 代表權限的圖示。此屬性必須設定為對包含映像檔定義的可繪製資源的參照。
android:label
- 使用者可理解的群組名稱。為了方便起見 可以在開發應用程式時直接設為原始字串。 不過,當您準備發布應用程式時,請將其進行設定 做為字串資源的參照,這樣才能像其他物件一樣進行本地化 字串。
android:name
- 群組名稱。該名稱可指派給
<permission>
元素的android:permissionGroup
屬性。
- 導入版本:
- API 級別 1
- 另請參閱:
<permission>
<permission-tree>
<uses-permission>
<權限群組>
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。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,["# <permission-group\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cpermission-group android:description=\"string resource\"\n android:icon=\"drawable resource\"\n android:label=\"string resource\"\n android:name=\"string\" /\u003e\n ```\n\ncontained in:\n: [\u003cmanifest\u003e](/guide/topics/manifest/manifest-element)\n\ndescription:\n: Declares a name for a logical grouping of related permissions. Individual\n permissions join the group through the `permissionGroup` attribute of the\n [\u003cpermission\u003e](/guide/topics/manifest/permission-element) element. Members of a group are\n presented together in the user interface.\n\n\n This element doesn't declare a permission itself, only a category in which permissions can be placed.\n For information about declaring permissions and assigning them to groups, see the\n [\u003cpermission\u003e](/guide/topics/manifest/permission-element) element.\n\nattributes:\n:\n\n `android:description`\n : User-readable text that describes the group. The text is\n longer and more explanatory than the label. This attribute must be\n set as a reference to a string resource. Unlike the `label`\n attribute, it can't be a raw string.\n\n `android:icon`\n : An icon representing the permission. This attribute must be set\n as a reference to a drawable resource containing the image definition.\n\n `android:label`\n : A user-readable name for the group. As a convenience, the label\n can be directly set as a raw string while you're developing the application.\n However, when the application is ready to be published, set it\n as a reference to a string resource, so that it can be localized like other\n strings in the user interface.\n\n `android:name`\n : The name of the group. This is the name that can be assigned to a\n [\u003cpermission\u003e](/guide/topics/manifest/permission-element)\n element's\n [android:permissionGroup](/guide/topics/manifest/permission-element#pgroup)\n attribute.\n\nintroduced in:\n: API level 1\n\nsee also:\n: [\u003cpermission\u003e](/guide/topics/manifest/permission-element)\n\n [\u003cpermission-tree\u003e](/guide/topics/manifest/permission-tree-element)\n\n [\u003cuses-permission\u003e](/guide/topics/manifest/uses-permission-element)"]]