- תחביר:
<category android:name="string" />
- בתוך:
<intent-filter>
- תיאור:
- הוספת שם קטגוריה למסנן Intent. צפייה כוונות וכן מסנני Intent לפרטים על מסנני Intent והתפקיד של קטגוריה מפרטים בתוך מסנן.
- :
android:name
- שם הקטגוריה. קטגוריות סטנדרטיות מוגדרות
Intent
כיתה בתורCATEGORY_name
קבועים. השם שמוקצה כאן נגזר מהקבועים האלה על ידי הוספת התחיליתandroid.intent.category.
לפונקצייתname
אחריCATEGORY_
. לדוגמה, ערך המחרוזת שלCATEGORY_LAUNCHER
הואandroid.intent.category.LAUNCHER
.הערה: כדי לקבל כוונות מרומזות, צריך לכלול את הקטגוריה
CATEGORY_DEFAULT
במסנן Intent. השיטותstartActivity()
והקבוצהstartActivityForResult()
מתייחסים לכל הכוונות כאילו הם הצהירו על הקטגוריהCATEGORY_DEFAULT
. אם לא תצהירו על כך במסנן Intent, אי אפשר יהיה לזהות כוונות מרומזות בפעילות שלכם.לקטגוריות מותאמות אישית, יש להשתמש בשם החבילה כקידומת. שהם ייחודיים.
- הושקו ב:
- רמת API 1
- למידע נוסף:
<action>
<data>
<category>
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[[["התוכן קל להבנה","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 (שעון UTC)."],[],[],null,["# <category\u003e\n\nsyntax:\n:\n\n ```xml\n \u003ccategory android:name=\"string\" /\u003e\n ```\n\ncontained in:\n: [\u003cintent-filter\u003e](/guide/topics/manifest/intent-filter-element)\n\ndescription:\n: Adds a category name to an intent filter. See\n [Intents and\n Intent Filters](/guide/components/intents-filters) for details on intent filters and the role of category\n specifications within a filter.\n\nattributes:\n:\n\n `android:name`\n : The name of the category. Standard categories are defined in the\n [Intent](/reference/android/content/Intent) class as `CATEGORY_`*name*\n constants. The name assigned here is derived from those constants\n by prefixing `android.intent.category.` to the\n *name* that follows `CATEGORY_`. For example,\n the string value for `CATEGORY_LAUNCHER` is\n `android.intent.category.LAUNCHER`.\n\n **Note:** To receive implicit intents, you must include the\n [CATEGORY_DEFAULT](/reference/android/content/Intent#CATEGORY_DEFAULT) category in the intent filter. The methods\n [startActivity()](/reference/android/app/Activity#startActivity(android.content.Intent)) and\n [startActivityForResult()](/reference/android/app/Activity#startActivityForResult(android.content.Intent, int)) treat all intents\n as if they declared the [CATEGORY_DEFAULT](/reference/android/content/Intent#CATEGORY_DEFAULT) category.\n If you don't declare it in your intent filter, no implicit intents can resolve\n your activity.\n\n\n For custom categories, use the package name as a prefix so\n that they are unique.\n\nintroduced in:\n: API Level 1\n\nsee also:\n: [\u003caction\u003e](/guide/topics/manifest/action-element)\n\n [\u003cdata\u003e](/guide/topics/manifest/data-element)"]]