<activity>

syntax:
<activity android:allowTaskReparenting=["true" | "false"]
          android:alwaysRetainTaskState=["true" | "false"]
          android:clearTaskOnLaunch=["true" | "false"]
          android:configChanges=["mcc", "mnc", "locale",
                                 "touchscreen", "keyboard", "keyboardHidden",
                                 "navigation", "orientation", "fontScale"]
          android:enabled=["true" | "false"]
          android:excludeFromRecents=["true" | "false"]
          android:exported=["true" | "false"]
          android:finishOnTaskLaunch=["true" | "false"]
          android:icon="drawable resource"
          android:label="string resource"
          android:launchMode=["multiple" | "singleTop" |
                              "singleTask" | "singleInstance"]
          android:multiprocess=["true" | "false"]
          android:name="string"
          android:noHistory=["true" | "false"]  
          android:permission="string"
          android:process="string"
          android:screenOrientation=["unspecified" | "user" | "behind" |
                                     "landscape" | "portrait" |
                                     "sensor" | "nosensor"]
          android:stateNotNeeded=["true" | "false"]
          android:taskAffinity="string"
          android:theme="resource or theme"
          android:windowSoftInputMode=["stateUnspecified",
                                       "stateUnchanged", "stateHidden",
                                       "stateAlwaysHidden", "stateVisible",
                                       "stateAlwaysVisible", "adjustUnspecified",
                                       "adjustResize", "adjustPan"] >   
    . . .
</activity>
contained in:
<application>
can contain:
<intent-filter>
<meta-data>
description:
Declares an activity (an Activity subclass) that implements part of the application's visual user interface. All activities must be represented by <activity> elements in the manifest file. Any that are not declared there will not be seen by the system and will never be run.
애플리케이션의 비쥬얼 사용자 인터페이스의 일부를 구현하는 액티비티(Activity 서브클래스)를 선언한다. 모든 액티비티는 매니페스트 파일에 있는 <activity> 엘리먼트에 의해 표현되어야 한다. 그곳에 선언되지 않은 어떤 것도 시스템에 의해 보여지지 않을 것이고 결코 실행되지 않을 것이다.
attributes:
android:allowTaskReparenting
Whether or not the activity can move from the task that started it to the task it has an affinity for when that task is next brought to the front "true" if it can move, and "false" if it must remain with the task where it started.

If this attribute is not set, the value set by the corresponding allowTaskReparenting attribute of the <application> element applies to the activity. The default value is "false".

Normally when an activity is started, it's associated with the task of the activity that started it and it stays there for its entire lifetime. You can use this attribute to force it to be re-parented to the task it has an affinity for when its current task is no longer displayed. Typically, it's used to cause the activities of an application to move to the main task associated with that application.

For example, if an e-mail message contains a link to a web page, clicking the link brings up an activity that can display the page. That activity is defined by the browser application, but is launched as part of the e-mail task. If it's reparented to the browser task, it will be shown when the browser next comes to the front, and will be absent when the e-mail task again comes forward.

The affinity of an activity is defined by the taskAffinity attribute. The affinity of a task is determined by reading the affinity of its root activity. Therefore, by definition, a root activity is always in a task with the same affinity. Since activities with "singleTask" or "singleInstance" launch modes can only be at the root of a task, re-parenting is limited to the "standard" and "singleTop" modes. (See also the launchMode attribute.)

액티비티가 그것을 시작했던 태스크로 부터 그것과 친화력affinity이 있는 태스크로, 그 태스크가 다음번에 프론트로 오게 될 때 이동할 수 있는지 여부. ? 만약 이동할 수 있다면, “참true”이고, 그것이 시작되었던 태스크에 남아있어야 한다면 “거짓false” 이다.

만약 이 애트리뷰트가 설정되지 않는다면, <application> 엘리먼트의 해당 allowTaskReparenting 애트리뷰트에 의해 설정된 값이 그 액티비티에 적용된다. 디폴트 값은 “거짓false”이다.

보통 액티비티가 시작될 때, 그것은 그것을 시작했던 액티비티의 태스크와 결합되며, 그것은 전체 생명주기 동안 그곳에 머무른다. 여러분은 그것의 현재 태스크가 더 이상 보여지지 않을 때, 그것이 친화력을 갖는 태스크로 부모를 바꾸게 하기 위해 이 애트리뷰트를 사용할 수 있다. 전형적으로, 그것은 애플리케이션의 액티비티가 그 애플리케이션과 결합된 메인 태스크로 이동하게 하기 위해 사용된다.

예를 들어 이메일 메시지가 웹 페이지에 대한 링크를 포함한다면, 링크를 클릭하는 것은 그 페이지를 표시할 수 있는 액티비티를 가져온다. 그 액티비티는 브라우저 애플리케이션에 의해 정의된다. 하지만 이메일 태스크의 일부로써 런치된다. 만약 그것이 브라우저 태스크로 부모를 바꾸게 된다면, 브라우저가 다음에 프론트로 오게 될 때 그것은 보여질 것이고, 이메일 태스크가 다시 앞으로 나올 때 사라질 것이다.

액티비티의 친화력affinity는 taskAffinity 애트리뷰트에 의해 정의된다. 태스크의 친화력은 그것의 루트 액티비티의 친화력을 읽음으로써 결정된다. 그러므로 정의된 대로 루트 액티비티는 같은 친화력을 가진 태스크 안에 항상 있다. “singleTask” 또는 “singleInstance” 런치 모드를 가지는 액티비티는 오직 태스크의 루트에만 있을 수 있기 때문에, 부모를 바꾸는 것은 “standard”과 “singleTop” 모드에 제한된다(launchMode 애트리뷰트를 보라).

android:alwaysRetainTaskState
Whether or not the state of the task that the activity is in will always be maintained by the system "true" if it will be, and "false" if the system is allowed to reset the task to its initial state in certain situations. The default value is "false". This attribute is meaningful only for the root activity of a task; it's ignored for all other activities.

Normally, the system clears a task (removes all activities from the stack above the root activity) in certain situations when the user re-selects that task from the home screen. Typically, this is done if the user hasn't visited the task for a certain amount of time, such as 30 minutes.

However, when this attribute is "true", users will always return to the task in its last state, regardless of how they get there. This is useful, for example, in an application like the web browser where there is a lot of state (such as multiple open tabs) that users would not like to lose.

액티비티가 존재하는 태스크의 상태가 시스템에 의해 항상 유지되어질 것인가 여부. ? 만약 그것이 존재할 것이라면 “참true”. 만약 시스템이 특정 상황에서 그것의 초기 상태로 태스크를 재설정하는 것이 허용된다면 “거짓false”. 디폴트 값은 “거짓false”. 이 애트리뷰트는 태스크의 루트 액티비티에 대해서만 의미를 가진다; 그것은 다른 모든 액티비티에 대해선 무시된다.

보통 시스템은 사용자가 홈스크린으로부터 그 태스크를 재선택할 때, 특정 상황에서 그 태스크를 비운다(루트 액티비티 위에 있는 스택의 모든 액티비티들을 제거한다). 전형적으로 이것은 사용자가 30분 가량의 일정 시간 동안 그 태스크를 방문하지 않을 때 행하여진다.

하지만 이 애트리뷰트가 “참true” 일 때, 사용자들이 어떻게 그 태스크에 왔는지와 상관없이 해당 태스크의 마지막 상태로 항상 돌아갈 것이다. 예를 들어 이것은 웹 브라우저와 같은 애플리케이션에서 사용자가 잃고 싶지 않는 (다양하게 열린 탭과 같은) 많은 상태가 있을 때 유용하다.

android:clearTaskOnLaunch
Whether or not all activities will be removed from the task, except for the root activity, whenever it is re-launched from the home screen "true" if the task is always stripped down to its root activity, and "false" if not. The default value is "false". This attribute is meaningful only for activities that start a new task (the root activity); it's ignored for all other activities in the task.

When the value is "true", every time users start the task again, they are brought to its root activity, regardless of what they were last doing in the task and regardless of whether they used BACK or HOME to last leave it. When the value is "false", the task may be cleared of activities in some situations (see the alwaysRetainTaskState attribute), but not always.

Suppose, for example, that someone launches activity P from the home screen, and from there goes to activity Q. The user next presses HOME, and then returns to activity P. Normally, the user would see activity Q, since that is what they were last doing in P's task. However, if P set this flag to "true", all of the activities on top of it (Q in this case) were removed when the user pressed HOME and the task went to the background. So the user sees only P when returning to the task.

If this attribute and allowTaskReparenting are both "true", any activities that can be re-parented are moved to the task they share an affinity with; the remaining activities are then dropped, as described above.

태스크가 홈 스크린에서 다시 런치될 때, 루트 액티비티를 제외한 모든 액티비티가 태스크에서 제거될 것인지 여부. ? 만약 태스크가 그것의 루트 액티비티까지 항상 벗겨진다면 “참true” 그리고 아니라면 “거짓false”. 디폴트 값은 “거짓false”. 이 애트리뷰트는 신규 태스크를 시작하는 액티비티(루트 액티비티)에 대해서만 의미가 있다; 그 태스크 안의 다른 모든 액티비티에 대해서는 무시된다.

값이 “참true”일 때, 사용자가 태스크를 다시 시작할 때마다 그 태스크에서 그들이 마지막으로 했던 것이 무엇이든 상관없이, 그리고 그들이 그 태스크를 마지막으로 떠나기 위해 BACK 또는 HOME을 사용했던 것과 상관없이, 그들은 태스크의 루트 액티비티로 보내진다. 값이 “거짓false”일 때, 태스크는 어떤 상황(alwaysRetainTaskState 애트리뷰트를 보라.)에서 액티비티를 비우게 될 수도 있다. 하지만 항상은 아니다..

예를 들어 누군가가 홈스크린으로부터 액티비티 P를 런치하고, 거기에서 액티비티 Q로 간다고 가정하자. 사용자가 다음에 HOME을 누르고, 그런 다음에 액티비티 P로 돌아간다. 보통 그 사용자는 액티비티 Q를 볼 것이다. 왜냐하면 그것이 그들이 P의 태스크에서 마지막으로 하고 있었던 것이기 때문이다. 하지만, 만약 P가 이 플래그를 “참true”으로 설정한다면, 그것 위에 있는 모든 액티비티들(이 경우에는 Q)은 사용자가 HOME을 눌러서 그 태스크가 백그라운드로 갔을 때 제거된다. 그러므로 사용자가 그 태스크로 돌아올 때 오직 P만 보게 된다.

이 애트리뷰트와 allowTaskReparenting 모두가 “참true”이라면, 부모를 바꿀 수 있는 모든 액티비티들은 그들이 친화력을 공유하는 태스크로 이동된다; 위에서 처럼, 남겨진 액티비티는 이후 누락된다.

android:configChanges
Lists configuration changes that the activity will handle itself. When changes that are not listed occur, the activity is shut down and restarted. When a listed change occurs, the activity remains running and its onConfigurationChanged() method is called.

Any or all of the following strings can be used to set this attribute. Values are separated by '|' for example, "locale|navigation|orientation".

Value Description
"mcc" The IMSI mobile country code (MCC) has changed that is, a SIM has been detected and updated the MCC.
"mnc" The IMSI mobile network code (MNC) has changed that is, a SIM has been detected and updated the MNC.
"locale" The locale has changed for example, the user has selected a new language that text should be displayed in.
"touchscreen" The touchscreen has changed. (This should never normally happen.)
"keyboard" The keyboard type has changed for example, the user has plugged in an external keyboard.
"keyboardHidden" The keyboard accessibility has changed for example, the user has slid the keyboard out to expose it.
"navigation" The navigation type has changed. (This should never normally happen.)
"orientation" The screen orientation has changed that is, the user has rotated the device.
"fontScale" The font scaling factor has changed that is, the user has selected a new global font size.

All of these configuration changes can impact the resource values seen by the application. Therefore, when onConfigurationChanged() is called, it will generally be necessary to again retrieve all resources (including view layouts, drawables, and so on) to correctly handle the change.

액티비티가 스스로가 처리할 환경설정configuration 변화를 나열한다. 나열되지 않은 변화가 일어날 때, 액티비티는 종료되고 다시 시작된다. 나열된 변화가 일어날 때, 액티비티는 실행상태를 유지하고 그것의 onConfigurationChanged() 메쏘드가 호출된다.

다음에 나오는 문자열 중 어떤 것 또는 전부는 이 애트리뷰트를 설정하기 위해 사용될 수 있다. 값은 ‘|’에 의해 구분된다 ? 예를 들어, “locale| navigation|orientation”.

설명
"mcc" IMSI 모바일 국가 코드(MCC)가 변경되었다. ? 즉, SIM이 인식되었고, 그 MCC를 업데이트했다.
"mnc" IMSI 모바일 네트워크 코드(MNC)가 변경되었다 - 즉, SIM이 인식되었고, 그 MNC를 업데이트했다.
"locale" 로케일이 변경되었다. ? 예를 들어 사용자가 텍스트가 표시되어야 하는 새로운 언어를 선택했다.
"touchscreen" 터치스크린이 변경되었다. (이것은 결코 일반적으로 발생하지는 않는다.)
"keyboard" 키보드 타입이 변경되었다 - 예를 들어 사용자가 외부 키보드를 연결했다.
"keyboardHidden" 키보드 접근성이 변경되었다 - 예를 들어 사용자가 슬라이드 키보드가 보이도록 열었다.
"navigation" 네비게이션 타입이 변경되었다. (이것은 결코 일반적으로 발생하지 않는다.)
"orientation" 스크린 오리엔테이션이 변경되었다 - 즉, 사용자는 디바이스를 회전했다.
"fontScale" 폰트 크기 요소가 변경되었다 - 즉, 사용자는 새로운 글로벌 폰트사이즈를 선택했다.

이러한 모든 환경설정 변화는 애플리케이션에 의해 보여지는 리소스 값들에 영향을 줄 수있다. 그러므로 onConfigurationChanged()가 호출될 때, 정확하게 변화를 처리하기 위해 모든 리소스(뷰 레이아웃, 드로어블, 그리고 기타등등을 포함)를 다시 가져오는 것이 일반적으로 필요하게 될 것이다.

android:enabled
Whether or not the activity can be instantiated by the system "true" if it can be, and "false" if not. The default value is "true".

The <application> element has its own enabled attribute that applies to all application components, including activities. The <application> and <activity> attributes must both be "true" (as they both are by default) for the system to be able to instantiate the activity. If either is "false", it cannot be instantiated.

시스템에 의해 액티비티가 인스턴스화 될 수 있는 지 여부. ? 그것이 될 수 있다면 “참true” 아니라면 “거짓false”이다. 디폴트 값은 “참true”이다.

<application> 엘리먼트는 액티비티를 포함하는 모든 애플리케이션 컴포넌트들에 적용되는 그것 자신의 enabled 애트리뷰트를 가진다. <application>과 <activity>의 애트리뷰트는 시스템이 액티비티를 인스턴스화 할 수 있도록 하기 위해 둘 다 “참true”이 되어야 한다(디폴트로 둘 다 “참true”이다). 만약 어느 쪽이든 “거짓false”이라면, 그것은 인스턴스화 될 수 없다.

android:excludeFromRecents
Whether or not the activity should be excluded from the list of recently launched activities that can be displayed to users "true" if it should be excluded, and "false" if it should be included. The default value is "false".
액티비티가 사용자에게 표시될 수 있는 최근에 런치된 액티비티의 리스트에서 제외되어야 하는지 여부 ? 만약 그것이 제외되어야 한다면 “참true”이고, 그것이 포함되어져야 한다면 “거짓false”이다. 디폴트 값은 “거짓false”이다.
android:exported
Whether or not the activity can be launched by components of other applications "true" if it can be, and "false" if not. If "false", the activity can be launched only by components of the same application or applications with the same user ID.

The default value depends on whether the activity contains intent filters. The absence of any filters means that the activity can be invoked only by specifying its exact class name. This implies that the activity is intended only for application-internal use (since others would not know the class name). So in this case, the default value is "false". On the other hand, the presence of at least one filter implies that the activity is intended for external use, so the default value is "true".

This attribute is not the only way to limit an activity's exposure to other applications. You can also use a permission to limit the external entities that can invoke the activity (see the permission attribute).

액티비티가 다른 애플리케이션의 컴포넌트에 의해 런치될 수 있는지 여부.? 만약 그것이 될 수 있다면 “참true” 아니라면 “거짓false”. 만약 “거짓false”이라면, 액티비티는 같은 애플리케이션 또는 같은 유저 ID를 가진 애플리케이션의 컴포넌트에 의해서만 런치될 수 있다.

디폴트 값은 액티비티가 인텐트 필터를 포함하는 지 여부에 달려 있다. 어떤 필터도 없다는 것은 액티비티가 그것의 정확한 클래스 이름을 명시하는 것에 의해서만 호출될 수 있다는 것을 의미한다. 이것은 액티비티가 애플리케이션 내부용으로만 의도되었다는 것을 의미한다(왜냐하면 다른 것들은 클래스 이름을 모를 것이기 때문이다). 그러므로 이런 경우에, 디폴트 값은 “거짓false”이다. 반면에, 적어도 하나의 필터가 존재한다는 것은 액티비티가 외부 사용을 위해 의도되었다는 것을 의미한다. 그래서 디폴트 값은 “참true”이다.

이 애트리뷰트가 다른 애플리케이션에게 액티비티의 노출을 제한하는 유일한 방법은 아니다. 여러분은 액티비티를 호출할 수 있는 외부 엔티티를 제한하는 퍼미션을 또한 사용할 수 있다(permission 애트리뷰트를 보라).

android:finishOnTaskLaunch
Whether or not an existing instance of the activity should be shut down (finished) whenever the user again launches its task (chooses the task on the home screen) "true" if it should be shut down, and "false" if not. The default value is "false".

If this attribute and allowTaskReparenting are both "true", this attribute trumps the other. The affinity of the activity is ignored. The activity is not re-parented, but destroyed.

사용자가 다시 그것의 태스크(홈스크린에서 태스크를 선택한다)을 런치할 때마다 액티비티의 기존 인스턴스가 종료되어야 하는 지 여부 ? 만약 종료되어야 한다면 “참true” 아니라면 “거짓false”이다. 디폴트 값은 “거짓false”이다.

만약 이 애트리뷰트와 allowTaskReparenting 모두가 “참true”이라면, 이 애트리뷰트가 다다른 것에 우선한다. 그 액티비티의 친화력은 무시된다. 액티비티는 부모를 바꾸지 않고 파괴된다.

android:icon
An icon representing the activity. The icon is displayed to users when a representation of the activity is required on-screen. For example, icons for activities that initiate tasks are displayed in the launcher window. The icon is often accompanied by a label (see the label attribute).

This attribute must be set as a reference to a drawable resource containing the image definition. If it is not set, the icon specified for the application as a whole is used instead (see the <application> element's icon attribute).

The activity's icon whether set here or by the <application> element is also the default icon for all the activity's intent filters (see the <intent-filter> element's icon attribute).

액티비티를 표시하는 아이콘. 액티비티에 대한 표시가 스크린 상에 요구될 때 아이콘이 사용자에게 보여진다. 예를 들어 태스크를 시작시키는 액티비티에 대한 아이콘은 런처 윈도우에서 보여진다. 아이콘은 종종 라벨을 수반한다 (label 애트리뷰트를 보라).

이 애트리뷰트는 이미지 정의를 포함하는 드로어블drawable 리소스에 대한 레퍼런스로써 설정되어야 한다. 만약 그것이 설정되지 않으면, 전체 애플리케이션을 위해 지정된 아이콘이 대신 사용된다(<application> 엘리먼트의 icon 애트리뷰트를 보라).

액티비티의 아이콘 ? 여기서 설정되던 또는 <application> 엘리먼트에 의해 설정되던 - 은 또한 모든 액티비티의 인텐트 필터를 위한 디폴트 아이콘이다(<intent-filter> 엘리먼트 icon 애트리뷰트를 보라).

android:label
A user-readable label for the activity. The label is displayed on-screen when the activity must be represented to the user. It's often displayed along with the activity icon.

If this attribute is not set, the label set for the application as a whole is used instead (see the <application> element's label attribute).

The activity's label whether set here or by the <application> element is also the default label for all the activity's intent filters (see the <intent-filter> element's label attribute).

The label should be set as a reference to a string resource, so that it can be localized like other strings in the user interface. However, as a convenience while you're developing the application, it can also be set as a raw string.

액티비티에 대해 사용자가 읽을 수 있는 라벨. 라벨은 액티비티가 사용자에게 표시되어져야 할 때 화면 상에 보여진다. 그것은 액티비티 아이콘과 함께 자주 보여진다.

만약 이 애트리뷰트가 설정되지 않으면, 전체 애플리케이션에 대한 라벨 설정이 대신 사용된다(<application> 엘리먼트의 label 애트리뷰트를 보라).

액티비티의 라벨 ? 여기서 설정되던 또는 <application> 엘리먼트에 의해 설정되던 - 은 또한 모든 액티비티의 인텐트 필터에 대한 디폴트 라벨이다 (<intent-filter> 엘리먼트의 label 애트리뷰트를 보라).

라벨은 사용자 인터페이스에 있는 다른 문자열 처럼 로컬라이즈localize될 수 있도록 하기 위해 문자열 리소스에 대한 레퍼런스로써 설정되어야 한다. 하지만 여러분이 애플리케이션을 개발하는 동안 편의상, 그것은 원시 문자열로 또한 설정될 수 있다.

android:launchMode
An instruction on how the activity should be launched. There are four modes that work in conjunction with activity flags (FLAG_ACTIVITY_* constants) in Intent objects to determine what should happen when the activity is called upon to handle an intent. They are:

"standard"
"singleTop"
"singleTask"
"singleInstance"

The default mode is "standard".

The modes fall into two main groups, with "standard" and "singleTop" activities on one side, and "singleTask" and "singleInstance" activities on the other. An activity with the "standard" or "singleTop" launch mode can be instantiated multiple times. The instances can belong to any task and can be located anywhere in the activity stack. Typically, they're launched into the task that called startActivity() (unless the Intent object contains a FLAG_ACTIVITY_NEW_TASK instruction, in which case a different task is chosen see the taskAffinity attribute).

In contrast, "singleTask" and "singleInstance" activities can only begin a task. They are always at the root of the activity stack. Moreover, the device can hold only one instance of the activity at a time only one such task.

The "standard" and "singleTop" modes differ from each other in just one respect: Every time there's new intent for a "standard" activity, a new instance of the class is created to respond to that intent. Each instance handles a single intent. Similarly, a new instance of a "singleTop" activity may also be created to handle a new intent. However, if the target task already has an existing instance of the activity at the top of its stack, that instance will receive the new intent (in an onNewIntent() call); a new instance is not created. In other circumstances for example, if an existing instance of the "singleTop" activity is in the target task, but not at the top of the stack, or if it's at the top of a stack, but not in the target task a new instance would be created and pushed on the stack.

The "singleTask" and "singleInstance" modes also differ from each other in only one respect: A "singleTask" activity allows other activities to be part of its task. It's at the root of the activity stack, but other activities (necessarily "standard" and "singleTop" activities) can be launched into the same task. A "singleInstance" activity, on the other hand, permits no other activities to be part of its task. It's the only activity in the task. If it starts another activity, that activity is assigned to a different task as if FLAG_ACTIVITY_NEW_TASK was in the intent.

For more information on launch modes and their interaction with Intent flags, see the Activities and Tasks section of the Application Fundamentals document.

액티비티가 어떻게 런치되어야 하는 지에 대한 명령. 인텐트를 처리하기 위해 액티비티가 호출될 때 무엇이 발생해야 하는 지를 결정하기 위해, 인텐트 오브젝트의 액티비티 플래그(FLAG_ACTIVITY_* 상수)와 함께 동작하는 네 가지 모드가 있다. 그것은 다음과 같다.

"standard" "singleTop" "singleTask" "singleInstance"

디폴트의 모드는 “standard”이다

그 모드들은 두 가지 주요 그룹으로 나뉘어 진다. 한쪽에는 “standard” 와 “singleTop” 액티비티들이 있으며, 다른 한쪽에는 “singleTask” 와 “singleInstance”가 있다. “standard” 또는 “singleTop” 런치 모드를 가지는 액티비티는 여러 번 인스턴스화 될 수 있다. 인스턴스는 어떤 태스크에도 속할 수 있으며, 그리고 액티비티 스택의 어느 곳에든 놓여질 수 있다. 일반적으로 그것들은 startActivity()를 호출한 태스크에서 런치된다(인텐트 오브젝트가 FLAG_ACTIVITY_NEW_TASK 명령을 포함하지 않는 한 그러하며, 이 경우에는 다른 태스크가 선택되어 진다 - taskAffinity 애트리뷰트를 보라).

그에 반하여, “singleTask” 와 “singleInstance” 액티비티들은 오직 하나의 태스크를 시작할 수 있다. 그것들은 항상 액티비티 스택의 루트에 위치한다. 더욱이, 디바이스는 한 번에 ? 오직 하나의 그 태스크에서 오직 하나의 액티비티 인스턴스를 보유할 수 있다.

“standard” 와 “singleTop” 모드는 단지 한 측면에서만 서로 차이가 있다: “standard” 액티비티를 위한 신규 인텐트가 있을 때마다, 신규 클래스 인스턴스가 그 인텐트에 응답하기 위해 생성된다. 각각의 인스턴스는 하나의 인텐트를 처리한다. 비슷하게 “singleTop” 액티비티에 대한 신규 인스턴스 또한 신규 인텐트를 처리하기 위해 생성될 수 있다. 하지만 타겟 태스크가 이미 그것의 스택의 최상위에 그 액티비티에 대한 인스턴스를 가지고 있다면, 그 인스턴스가 신규 인텐트를 수신할 것이다(onNewIntent() 호출에서); 신규 인스턴스는 생성되지 않는다. 다른 상황에서는 - 예를 들어 만약 “singleTop” 액티비티에 대한 이미 존재하는 인스턴스가 타겟 태스크에 있으나 그것이 스택의 최상위에 있지 않다면, 또는 그것이 스택의 최상위에 있으나 타겟 태스크에는 있지 않다면 ? 신규 인스턴스는 생성될 것이고 스택에 푸쉬된다.

“singleTask” 와 “singleInstance” 모드들 또한 오직 한 측면에서만 서로 차이가 있다: “singleTask” 액티비티는 다른 액티비티가 그것의 태스크의 일부가 되는 것을 허용한다. 그것은 액티비티 스택의 루트에 있으나, 다른 액티비티들(반드시 “standard” 와 “singleTop” 액티비티)은 같은 태스크에서 런치될 수 있다. 반면에, “singleInstance” 액티비티는 어떤 액티비티도 그것의 태스크의 일부가 되는 것을 허용하지 않는다. 그것은 태스크 안에 있는 유일한 액티비티이다. 만약 그것이 다른 액티비티를 시작한다면, 그 액티비티는 다른 태스크에 할당된다 ? 마치 FLAG_ACTIVITY_NEW_TASK가 인텐트에 있었던 것처럼.

런치 모드와 인텐트 플래그를 사용한 그것들의 상호작용에 대한 더 많은 정보는, 2장. “애플리케이션 기초”의 “액티비티와 태스크”를 보라.

android:multiprocess
Whether an instance of the activity can be launched into the process of the component that started it "true" if it can be, and "false" if not. The default value is "false".

Normally, a new instance of an activity is launched into the process of the application that defined it, so all instances of the activity run in the same process. However, if this flag is set to "true", instances of the activity can run in multiple processes, allowing the system to create instances wherever they are used (provided permissions allow it), something that is almost never necessary or desirable.

액티비티의 인스턴스가 그것을 시작했던 컴포넌트의 프로세스 안으로 런치될 수 있는지 여부 - 만약 그것이 될 수 있다면 “참true” 아니라면 “거짓false”이다. 디폴트 값은 “거짓false”이다.

보통, 액티비티의 신규 인스턴스는 그것을 정의한 애플리케이션의 프로세스 안으로 런치된다. 그러므로 액티비티의 모든 인스턴스는 같은 프로세스에서 실행된다. 하지만 만약 이 플래그가 “참true”으로 설정된다면, 그 액티비티의 인스턴스는 다양한 프로세스에서 실행될 수 있다. 그것은 시스템이 그것이 사용되는 (퍼미션이 그것을 허용한다면) 곳이 어디든 간에 그것을 생성하는 것을 허용한다. 하지만 그것은 결코 거의 필요치 않으며 바람직하지 않다.

android:name
The name of the class that implements the activity, a subclass of Activity. The attribute value should be a fully qualified class name (such as, "com.example.project.ExtracurricularActivity"). However, as a shorthand, if the first character of the name is a period (for example, ".ExtracurricularActivity"), it is appended to the package name specified in the <manifest> element.

There is no default. The name must be specified.

액티비티를 구현하는 클래스의 이름, 액티비티의 서브클래스. 그 애트리뷰트 값은 전체 클래스 이름을 가져야 한다(“com.example.project.ExtracurricularActivity” 과 같이). 하지만 축약으로 만약 이름의 첫 번째 캐릭터가 마침표라면(예를 들어 “.ExtracurricularActivity), 그것은 <manifest> 엘리먼트에 지정된 패키지 이름 끝에 붙여진다. 이곳에선 어떤 디폴트도 없다. 이름은 명시되어야 한다.

There is no default. The name must be specified.

android:noHistory
Whether or not the activity should be removed from the activity stack and finished (its finish() method called) when the user navigates away from it and it's no longer visible on screen "true" if it should be finished, and "false" if not. The default value is "false".

A value of "true" means that the activity will not leave a historical trace. It will not remain in the activity stack for the task, so the user will not be able to return to it.

This attribute was introduced in API Level 3.

사용자가 액티비티를 떠나서 더이상 그것이 스크린에 보이지 않게 되었을 때, 해당 액티비티가 액티비티의 스택에서 제거되고 종료(액티비티의 finish() 메쏘드가 호출됨)되어야 하는 지 여부 - 만약 그것이 종료되어야 한다면 “참true” 아니라면 “거짓false”. 디폴트 값은 “거짓false”이다.

“참true” 값은 그 액티비티가 과거의 자취를 남기지 않을 것임을 의미한다. 그것은 태스크를 위한 액티비티의 스택에 존재하지 않을 것이다. 그러므로 사용자는 그것에 돌아갈 수 없게 될 것이다.

이 애트리뷰트는 API 레벨 3에서 도입되었다.

android:permission
The name of a permission that clients must have to launch the activity or otherwise get it to respond to an intent. If a caller of startActivity() or startActivityForResult() has not been granted the specified permission, its intent will not be delivered to the activity.

If this attribute is not set, the permission set by the <application> element's permission attribute applies to the activity. If neither attribute is set, the activity is not protected by a permission.

For more information on permissions, see the Permissions section in the introduction and another document, Security and Permissions.

클라이언트가 액티비티를 런치하기 위해 보유해야 하거나 또는 그렇지 않다면 인텐트에 응답하기 위해 얻어야 하는 퍼미션의 이름. 만약 startActivity() 또는 startActivityForResult()의 호출자가 명시된 퍼미션을 부여받지 않으면, 그것의 인텐트는 해당 액티비티에 전달되지 않는다.

만약 이 애트리뷰트가 설정되지 않으면, 퍼미션은 <application> 엘리먼트의 퍼미션 애트리뷰트에 의해 설정된 퍼미션이 액티비티에 적용된다. 만약 어느 것도 애트리뷰트를 설정하지 않는다면, 액티비티는 퍼미션에 의해 보호되지 않는다.

퍼미션에 관한 더 많은 정보에 대해서는, 앞에 나왔던 퍼미션 섹션과 8장. “보안과 퍼미션”을 보라.

android:process
The name of the process in which the activity should run. Normally, all components of an application run in the default process created for the application. It has the same name as the application package. The <application> element's process attribute can set a different default for all components. But each component can override the default, allowing you to spread your application across multiple processes.

If the name assigned to this attribute begins with a colon (':'), a new process, private to the application, is created when it's needed and the activity runs in that process. If the process name begins with a lowercase character, the activity will run in a global process of that name, provided that it has permission to do so. This allows components in different applications to share a process, reducing resource usage.

액티비티가 실행되어야 하는 프로세스의 이름. 보통 애플리케이션의 모든 컴포넌트는 애플리케이션을 위해 생성되는 디폴트 프로세스 안에서 실행된다. 그 프로세스 이름은 애플리케이션 패키지와 같은 이름을 가진다. <application> 엘리먼트의 process 애트리뷰트는 모든 컴포넌트를 위한 다른 디폴트를 설정할 수 있다. 그러나 각각의 컴포넌트는 그 디폴트를 오버라이드 할 수 있으며, 여러분의 애플리케이션을 여러 개의 프로세스에 걸쳐서 분포시키는 것을 가능하게 한다.

만약 이 애트리뷰트에 지정된 이름이 콜론(‘:’)으로 시작된다면, 그 애플리케이션에게 프라이빗private한 신규 프로세스가 그것이 필요할 때 생성된다. 그리고 액티비티는 해당 프로세스에서 실행된다. 만약 그 프로세스 이름이 소문자로 시작된다면, 액티비티는 그 이름을 가진 글로벌 프로세스에서 실행될 것이며, 그 프로세스는 그렇게 하기 위한 퍼미션을 가진다. 이것은 다른 애플리케이션의 컴포넌트가 리소스 사용을 줄이기 위해 하나의 프로세스를 공유하는 것을 가능하게 한다.

android:screenOrientation
The orientation of the activity's display on the device. The value can be any one of the following strings:
"unspecified" The default value. The system chooses the orientation. The policy it uses, and therefore the choices made in specific contexts, may differ from device to device.
"landscape" Landscape orientation (the display is wider than it is tall).
"portrait" Portrait orientation (the display is taller than it is wide).
"user" The user's current preferred orientation.
"behind" The same orientation as the activity that's immediately beneath it in the activity stack.
"sensor" The orientation determined by a physical orientation sensor. The orientation of the display depends on how the user is holding the device; it changes when the user rotates the device.
"nosensor" An orientation determined without reference to a physical orientation sensor. The sensor is ignored, so the display will not rotate based on how the user moves the device. Except for this distinction, the system chooses the orientation using the same policy as for the "unspecified" setting.
디바이스 상에서 액티비티가 보여지는 오리엔테이션. 그 값은 아래 나오는 문자열들 중에 하나가 될 수 있다.
"unspecified" 디폴트 값. 시스템이 오리엔테이션을 선택한다. 그것이 사용하는 정책과 그러므로 특정 컨텍스트에서 만들어진 선택은 디바이스 마다 다를 수 있다.
"landscape" 가로 방향 오리엔테이션 (화면은 높이보다 너비가 크다.)
"portrait" 세로 방향 오리엔테이션 (화면은 너비보다 높이가 크다.)
"user" 액티비티 스택에서 그것 아래에 바로 있는 액티비티와 같은 오리엔테이션.
"behind" 사용자가 현재 선호하는 오리엔테이션.
"sensor" 물리적 오리엔테이션 센서에 의해 결정된 오리엔테이션. 화면의 오리엔테이션은 사용자가 디바이스를 어떻게 쥐고 있는가에 의존한다; 그것은 사용자가 디바이스를 회전시킬 때 변한다.
"nosensor" 물리적 오리엔테이션 센서를 참조하는 것 없이 결정되는 오리엔테이션. 센서는 무시된다. 그러므로 그 화면은 사용자가 디바이스를 움직이는 방법에 기반해서 회전하지 않을 것이다. 이 차이를 제외하고는, 시스템은 “unspecified” 셋팅에 대한 것과 같은 정책을 사용하여 오리엔테이션을 선택한다.
android:stateNotNeeded
Whether or not the activity can be killed and successfully restarted without having saved its state "true" if it can be restarted without reference to its previous state, and "false" if its previous state is required. The default value is "false".

Normally, before an activity is temporarily shut down to save resources, its onSaveInstanceState() method is called. This method stores the current state of the activity in a Bundle object, which is then passed to onCreate() when the activity is restarted. If this attribute is set to "true", onSaveInstanceState() may not be called and onCreate() will be passed null instead of the Bundle just as it was when the activity started for the first time.

A "true" setting ensures that the activity can be restarted in the absence of retained state. For example, the activity that displays the home screen uses this setting to make sure that it does not get removed if it crashes for some reason.

액티비티가 그것의 상태를 저장하지 않고 강제 종료되고 성공적으로 다시 시작될 수 있는 지 여부 - 만약 그것이 이전 상태를 참조하지 않고 재시작될 수 있다면 “참true” 그리고 만약 그것의 이전 상태가 요구되어진다면 “거짓false”이다. 디폴트 값은 “거짓false”이다.

보통, 액티비티가 임시로 종료되기 전에 리소스를 저장하기 위해, 그것의 onSaveInstanceState() 메쏘드가 호출된다. 이 메쏘드는 액티비티가 재시작될 때, onCreate()에 전달되는 번들Bundle 오브젝트에 그 액티비티의 현재 상태를 저장한다. 만약 이 애트리뷰트가 “참true”으로 설정되면 onSaveInstanceState()는 호출되지 않을 것이며, onCreate()는 번들Bundle 대신에 널null을 전달받을 것이다 ? 그것은 마치 액티비티가 처음 시작될 때와 같다.

“참true” 설정은 액티비티가 보유한 상태 없이 재시작 될 수 있는 것을 가능하게 한다. 예를 들어 홈 스크린을 보여주는 액티비티는 어떤 이유로 망가진다면 그것이 제거되지 않도록 보장하기 위해 이 설정을 사용한다.

android:taskAffinity
The task that the activity has an affinity for. Activities with the same affinity conceptually belong to the same task (to the same "application" from the user's perspective). The affinity of a task is determined by the affinity of its root activity.

The affinity determines two things the task that the activity is re-parented to (see the allowTaskReparenting attribute) and the task that will house the activity when it is launched with the FLAG_ACTIVITY_NEW_TASK flag.

By default, all activities in an application have the same affinity. You can set this attribute to group them differently, and even place activities defined in different applications within the same task. To specify that the activity does not have an affinity for any task, set it to an empty string.

If this attribute is not set, the activity inherits the affinity set for the application (see the <application> element's taskAffinity attribute). The name of the default affinity for an application is the package name set by the <manifest> element.

액티비티가 친화력affinity을 가지는 태스크. 동일 친화력을 가지는 액티비티는 개념적으로 동일한 태스크(사용자 관점에서는 같은 “application”)에 속한다. 태스크의 친화력은 그것의 루트 액티비티의 친화력에 의해 결정된다.

친화력은 두 가지 것을 결정한다 ? 액티비티가 다시 부모로 설정하게 되는 태스크(allowTaskReparenting 애트리뷰트를 보라)와 액티비티가 FLAG_ACTIVITY_NEW_TASK 플래그를 가지고 런치될 때 그것을 보유할 태스크.

디폴트로, 애플리케이션의 모든 액티비티는 동일한 친화력을 가진다. 여러분은 그것들을 다르게 그룹화하기 위해 이 애트리뷰트를 설정할 수 있고, 심지어 동일한 태스크 내에 다른 애플리케이션 안에서 정의된 액티비티를 배치할 수도 있다. 액티비티가 어떤 태스크에 대해 친화력을 가지지 않게 지정하기 위해서는, 그것에 빈 문자열을 설정하라.

만약 이 애트리뷰트가 설정되지 않으면, 액티비티는 애플리케이션에 대해 설정된 친화력을 상속한다(<application> 엘리먼트의 taskAffinity 애트리뷰트를 보라). 애플리케이션에 대한 디폴트 친화력의 이름은 <manifest> 엘리먼트에 의해 설정된 패키지 이름이다.

android:theme
A reference to a style resource defining an overall theme for the activity. This automatically sets the activity's context to use this theme (see setTheme(), and may also cause "starting" animations prior to the activity being launched (to better match what the activity actually looks like).

If this attribute is not set, the activity inherits the theme set for the application as a whole see the <application> element's theme attribute. If that attribute is also not set, the default system theme is used.

액티비티에 대한 전체 테마를 정의하는 스타일 리소스에 대한 레퍼런스. 이것은 자동으로 액티비티의 컨텍스트에 이 테마(setTheme()를 보라)를 사용하도록 설정한다. 그리고 액티비티가 런치되기에 앞서서 “시작starting” 애니메이션을 또한 만들 지도 모른다(그 액티비티는 실제로 보이는 것과 더 잘 일치하도록 하기 위해).

만약 이 애트리뷰트가 설정되지 않으면, 액티비티는 애플리케이션 전체에 설정된 테마를 상속한다 - <application> 엘리먼트의 theme 애트리뷰트를 보라. 만약 그 애트리뷰트 또한 설정되지 않으면, 디폴트 시스템 테마가 사용된다.

android:windowSoftInputMode
How the main window of the activity interacts with the window containing the on-screen soft keyboard. The setting for this attribute affects two things:
  • The state of the soft keyboard whether it is hidden or visible when the activity becomes the focus of user attention.
  • The adjustment made to the activity's main window whether it is resized smaller to make room for the soft keyboard or whether its contents pan to make the current focus visible when part of the window is covered by the soft keyboard.

The setting must be one of the values listed in the following table, or a combination of one "state..." value plus one "adjust..." value. Setting multiple values in either group multiple "state..." values, for example &mdash has undefined results. Individual values are separated by a vertical bar (|). For example:

<activity android:windowSoftInputMode="stateVisible|adjustResize" . . . >

Values set here (other than "stateUnspecified" and "adjustUnspecified") override values set in the theme.

Value Description
"stateUnspecified" The state of the soft keyboard (whether it is hidden or visible) is not specified. The system will choose an appropriate state or rely on the setting in the theme.

This is the default setting for the behavior of the soft keyboard.

"stateUnchanged" The soft keyboard is kept in whatever state it was last in, whether visible or hidden, when the activity comes to the fore.
"stateHidden" The soft keyboard is hidden when the user chooses the activity that is, when the user affirmatively navigates forward to the activity, rather than backs into it because of leaving another activity.
"stateAlwaysHidden" The soft keyboard is always hidden when the activity's main window has input focus.
"stateVisible" The soft keyboard is visible when that's normally appropriate (when the user is navigating forward to the activity's main window).
"stateAlwaysVisible" The soft keyboard is made visible when the user chooses the activity that is, when the user affirmatively navigates forward to the activity, rather than backs into it because of leaving another activity.
"adjustUnspecified" It is unspecified whether the activity's main window resizes to make room for the soft keyboard, or whether the contents of the window pan to make the currentfocus visible on-screen. The system will automatically select one of these modes depending on whether the content of the window has any layout views that can scroll their contents. If there is such a view, the window will be resized, on the assumption that scrolling can make all of the window's contents visible within a smaller area.

This is the default setting for the behavior of the main window.

"adjustResize" The activity's main window is always resized to make room for the soft keyboard on screen.
"adjustPan" The activity's main window is not resized to make room for the soft keyboard. Rather, the contents of the window are automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing. This is generally less desireable than resizing, because the user may need to close the soft keyboard to get at and interact with obscured parts of the window.

This attribute was introduced in API Level 3.

액티비티의 메인 윈도우가 스크린상의 소프트 키보드를 포함한 윈도우와 어떻게 상호작용하는 지를 기술한다. 이 애트리뷰트에 대한 설정은 다음 두가지에 영향을 준다:
  • 소프트 키보드 상태 - 액티비티가 사용자 관심의 포커스를 받을 때 소프트 키보드가 보여지는 지 또는 숨겨지는 지의 여부.
  • 액티비티 메인 윈도우에 대한 조정 - 소프트 키보드를 위한 공간을 만들기 위해 액티비티 메인 윈도우를 작게 줄일 지의 여부 또는 메인 윈도우 일부가 소프트 키보드에 의해 가려질 때 현재 포커스를 보이도록 하기 위해 메인 윈도우의 컨텐트가 상하로 움직일 지의 여부.

셋팅 값은 다음 테이블에 나열된 값들의 하나 또는 하나의 “state...” 값과 하나의 “adjust...” 값의 조합이어야 한다. 다수의 “state...” 값들과 같이 다수의 값들을 설정하는 것은 정의되지 않은 결과를 가진다. 개개의 값들은 수직바(|)에 의해 의해 구분된다. 예를 들어 아래와 같다.

<activity android:windowSoftInputMode="stateVisible|adjustResize" . . . >

여기에 설정된 값들(“stateUnspecified”와 “adjustUnspecified” 제외)은 테마에 설정된 값들을 오버라이드한다.

설 명
"stateUnspecified" 소프트 키보드의 상태(소프트 키보드가 숨겨질 지 또는 보여질 지 여부)는 지정되지 않는다. 시스템이 적절한 상태를 선택하거나 테마 설정 값에 의존할 것이다. 이 값은 소프트 키보드에 대한 디폴트 설정 값이다.

이 값은 소프트 키보드에 대한 디폴트 설정 값이다.

"stateUnchanged" 액티비티가 포어그라운드로 올라올 때 소프트 키보드는 보여지든 숨겨지든 마지막으로 있었던 상태로 유지된다.
"stateHidden" 사용자가 액티비티를 선택할 때 소프트 키보드는 숨겨진다. 즉, 이것은 사용자가 또 다른 액티비티를 떠나서 그 액티비티로 뒤돌아가는 것보다는 앞으로 그 액티비티로 갈 때 해당된다.
"stateAlwaysHidden" 액티비티의 메인 윈도우가 입력 포커스를 가질 때 소프트 키보드는 항상 숨겨진다.
"stateVisible" 소프트 키보드가 정상적으로 적합할 때 (사용자가 액티비티의 메인 윈도우로 앞으로 갈 때) 소프트 키보드는 보여진다.
"stateAlwaysVisible" 사용자가 액티비티를 선택할 때 소프트 키보드는 보여지도록 만들어진다. 즉, 이것은 사용자가 또 다른 액티비티를 떠나서 그 액티비티로 뒤돌아 가는 것보다는 앞으로 그 액티비티로 갈 때 해당된다.
"adjustUnspecified" 소프트 키보드를 위한 공간을 만들기 위해 액티비티의 메인 윈도우가 작게 줄어지는 지의 여부 또는 메인 윈도우의 현재 포커스를 스크린 상에 보이도록 하기 위해 메인 윈도우의 컨텐츠가 상하로 움질일 지의 여부를 지정하지 않는다. 윈도우의 컨텐츠가 스크롤할 수 있는 레이아웃 뷰들을 가지고 있는 지 여부에 따라 시스템은 이 모드들 중의 하나를 자동으로 선택할 것이다. 만약 그런 뷰가 있다면, 스크롤링이 더 작은 영역에서 모든 윈도우 컨텐츠를 보이게 할 수 있다는 가정하에 윈도우의 크기는 재조정될 것이다.

이 값이 메인 윈도우에 대한 디폴트 설정 값이다.

"adjustResize" 액티비티의 메인 윈도우는 스크린 상의 소프트 키보드를 위한 공간을 만들기 위해 항상 그것의 크기가 재조정될 것이다.
"adjustPan" 소프트 키보드를 위한 공간을 만들기 위해서 액티비티의 메인 윈도우 크기는 재조정되지 않는다. 오히려, 윈도우의 현재 포커스가 키보드에 의해 결코 가려지지 않고 사용자가 입력하고 있는 걸들을 항상 볼 수 있도록 윈도우의 컨텐츠가 자동으로 상하로 움직여진다. 이것은 일반적으로 크기 재조정보다는 덜 바람직하다. 왜냐하면, 사용자는 윈도우의 가려진 부분에 접근해서 상호작용하기 위해 소프트 키보드를 종료할 수도 있기 때문이다.

이 애트리뷰트는 API 레벨 3에서 도입되었다.

introduced in:
API Level 1 for all attributes except for noHistory and windowSoftInputMode, which were added in API Level 3.
see also:
<application>
<activity-alias>
↑ Go to top