- 문법:
<activity-alias android:enabled=["true" | "false"] android:exported=["true" | "false"] android:icon="drawable resource" android:label="string resource" android:name="string" android:permission="string" android:targetActivity="string" > ... </activity-alias>
- 포함된 위치:
<application>
- 포함 가능한 요소:
<intent-filter>
<meta-data>
- 설명
- 활동의 별칭으로,
targetActivity
속성에서 이름이 지정됩니다. 타겟은 별칭과 동일한 애플리케이션에 있어야 하며 매니페스트에서 별칭보다 먼저 선언됩니다.별칭은 타겟 활동을 독립된 항목으로 나타내며, 고유한 인텐트 필터 세트가 있을 수 있습니다. 타겟 활동 자체의 인텐트 필터가 아닌 이러한 인텐트 필터 세트에서 어떤 인텐트가 별칭을 통해 타겟을 활성화할 수 있는지와 시스템에서 어떻게 별칭을 처리할지 결정합니다.
예를 들어 별칭의 인텐트 필터가
"android.intent.action.MAIN"
및"android.intent.category.LAUNCHER"
플래그를 지정하면 타겟 활동 자체의 필터가 이 플래그를 설정하지 않았더라도 활동이 애플리케이션 런처에 표시될 수 있습니다.targetActivity
를 제외하고<activity-alias>
속성은<activity>
속성의 하위 집합입니다. 하위 집합에 있는 속성의 경우 타겟에 설정된 어떤 값도 별칭에 적용되지 않습니다. 그러나 하위 집합에 없는 속성의 경우 타겟 활동에 설정된 값이 별칭에도 적용됩니다. - 속성:
android:enabled
- 시스템에서 이 별칭을 통해 타겟 활동을 인스턴스화할 수 있는지 여부입니다. 인스턴스화할 수 있으면
"true"
이고 인스턴스화할 수 없으면"false"
입니다. 기본값은"true"
입니다.<application>
요소에는 활동 별칭을 포함한 모든 애플리케이션 구성요소에 적용되는 고유한enabled
속성이 있습니다.<application>
및<activity-alias>
속성이 모두"true"
여야 시스템에서 별칭을 통해 타겟 활동을 인스턴스화할 수 있습니다. 둘 중 하나가"false"
이면 별칭을 사용할 수 없습니다. android:exported
- 다른 애플리케이션의 구성요소가 이 별칭을 통해 타겟 활동을 시작할 수 있는지 여부입니다. 시작할 수 있으면
"true"
이고 시작할 수 없으면"false"
입니다."false"
이면 별칭과 동일한 애플리케이션 또는 사용자 ID가 동일한 애플리케이션의 구성요소만 별칭을 통해 타겟 활동을 시작할 수 있습니다.기본값은 별칭에 인텐트 필터가 포함되는지 여부에 따라 다릅니다. 필터가 없는 경우에는 정확한 별칭 이름을 지정해야만 별칭을 통해 활동을 호출할 수 있습니다. 이는 별칭이 애플리케이션 내부용으로만 사용된다는 것을 의미하므로(다른 애플리케이션이 별칭 이름을 알지 못함) 기본값은
"false"
입니다. 반면 필터가 한 개 이상 있으면 별칭이 외부용이라는 것을 의미하므로 기본값은"true"
입니다. android:icon
- 별칭을 통해 사용자에게 표시되는 타겟 활동의 아이콘입니다.
자세한 내용은
<activity>
요소의icon
속성을 참고하세요. android:label
- 별칭을 통해 활동이 사용자에게 표시될 때 사용자가 읽을 수 있는 별칭 라벨입니다.
자세한 내용은
<activity>
요소의label
속성을 참고하세요. android:name
- 별칭의 고유한 이름입니다. 이름은 정규화된 클래스 이름과 비슷합니다. 하지만 별칭 이름은 타겟 활동 이름과 달리 임의적이며 실제 클래스를 가리키지 않습니다.
android:permission
- 클라이언트가 타겟 활동을 시작하거나 별칭을 통해 타겟 활동이 무언가를 하도록 만드는 데 필요한 권한의 이름입니다.
startActivity()
또는startActivityForResult()
호출자에 지정 권한이 부여되지 않았다면 타겟 활동이 활성화되지 않습니다.이 속성은 타겟 활동 자체에 설정된 모든 권한을 대체합니다. 이 속성을 설정하지 않으면 별칭을 통해 타겟을 활성화하는 데 권한이 필요하지 않습니다.
권한에 관한 자세한 내용은 앱 매니페스트 개요의 권한 섹션을 참고하세요.
android:targetActivity
- 별칭을 통해 활성화할 수 있는 활동의 이름입니다.
이 이름은 매니페스트에서 별칭 앞에 나오는
<activity>
요소의name
속성과 일치해야 합니다.
- 도입 수준:
- API 수준 1
- 참고 항목:
<activity>
<activity-alias>
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 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,["# <activity-alias\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cactivity-alias android:enabled=[\"true\" | \"false\"]\n android:exported=[\"true\" | \"false\"]\n android:icon=\"drawable resource\"\n android:label=\"string resource\"\n android:name=\"string\"\n android:permission=\"string\"\n android:targetActivity=\"string\" \u003e\n ...\n \u003c/activity-alias\u003e\n ```\n\ncontained in:\n: [\u003capplication\u003e](/guide/topics/manifest/application-element)\n\ncan contain:\n: [\u003cintent-filter\u003e](/guide/topics/manifest/intent-filter-element)\n\n [\u003cmeta-data\u003e](/guide/topics/manifest/meta-data-element)\n\ndescription:\n: An alias for an activity, named by the `targetActivity`\n attribute. The target must be in the same application as the\n alias and declared before the alias in the manifest.\n\n\n The alias presents the target activity as an independent entity, and can have its own set of intent\n filters. They, rather than the\n intent filters on the target activity itself, determine which intents\n can activate the target through the alias and how the system\n treats the alias.\n\n For example, the intent filters on the alias might\n specify the [\"android.intent.action.MAIN\"](/reference/android/content/Intent#ACTION_MAIN)\n and [\"android.intent.category.LAUNCHER\"](/reference/android/content/Intent#CATEGORY_LAUNCHER)\" flags, causing it to\n be represented in the application launcher, even though none of the\n filters on the target activity itself set these flags.\n\n\n With the exception of `targetActivity`, `\u003cactivity-alias\u003e`\n attributes are a subset of [\u003cactivity\u003e](/guide/topics/manifest/activity-element) attributes.\n For attributes in the subset, none of the values set for the target carry over\n to the alias. However, for attributes not in the subset, the values set for\n the target activity also apply to the alias.\n\nattributes:\n:\n\n `android:enabled`\n : Whether the target activity can be instantiated by the system through\n this alias. `\"true\"` if it can be, and `\"false\"` if not.\n The default value is `\"true\"`.\n\n\n The [\u003capplication\u003e](/guide/topics/manifest/application-element) element has its own\n [enabled](/guide/topics/manifest/application-element#enabled) attribute that applies to all\n application components, including activity aliases. The\n `\u003capplication\u003e` and `\u003cactivity-alias\u003e`\n attributes must both be `\"true\"` for the system to be able to instantiate\n the target activity through the alias. If either is `\"false\"`, the alias\n doesn't work.\n\n `android:exported`\n : Whether the components of other applications can launch the target activity\n through this alias. `\"true\"` if they can, and `\"false\"` if not.\n If `\"false\"`, the target activity can be launched through the alias only by\n components of the same application as the alias or applications with the same user ID.\n\n\n The default value depends on whether the alias contains intent filters. The\n absence of any filters means that the activity can be invoked through the alias\n only by specifying the exact name of the alias. This implies that the alias\n is intended only for application-internal use, since others don't know its name.\n So, the default value is `\"false\"`.\n On the other hand, the presence of at least one filter implies that the alias\n is intended for external use, so the default value is `\"true\"`.\n\n `android:icon`\n : An icon for the target activity when presented to users through the alias.\n For more information, see the [\u003cactivity\u003e](/guide/topics/manifest/activity-element) element's\n [icon](/guide/topics/manifest/activity-element#icon) attribute.\n\n `android:label`\n : A user-readable label for the alias when presented to users through the alias.\n For more information, see the [\u003cactivity\u003e](/guide/topics/manifest/activity-element) element's\n [label](/guide/topics/manifest/activity-element#label) attribute.\n\n \u003cbr /\u003e\n\n `android:name`\n\n : A unique name for the alias. The name resembles a fully qualified class name. But, unlike the name of the target activity, the alias name is arbitrary. It doesn't refer to an actual class. \u003cbr /\u003e\n\n `android:permission`\n : The name of a permission that clients must have to launch the target activity\n or get it to do something using the alias. If a caller of\n [startActivity()](/reference/android/content/Context#startActivity(android.content.Intent)) or\n [startActivityForResult()](/reference/android/app/Activity#startActivityForResult(android.content.Intent, int))\n isn't granted the specified permission, the target activity isn't activated.\n\n This attribute supplants any permission set for the target activity itself. If\n it isn't set, a permission isn't needed to activate the target through the alias.\n\n\n For more information about permissions, see the\n [Permissions](/guide/topics/manifest/manifest-intro#perms)\n section in the app manifest overview.\n\n `android:targetActivity`\n : The name of the activity that can be activated through the alias.\n This name must match the `name` attribute of an\n [\u003cactivity\u003e](/guide/topics/manifest/activity-element) element that precedes\n the alias in the manifest.\n\n \u003cbr /\u003e\n\nintroduced in:\n: API level 1\n\nsee also:\n: [\u003cactivity\u003e](/guide/topics/manifest/activity-element)"]]