xml layout의 tools attribute 는 어떤 activity와 관련되어 있는지 알려준다. Menifest에 테마를 정의하고 있을 시 어떤 테마와 관련이 있는지 editor에게 알려준다. 패키지 이름을 prefix로 가지고 있다. 아래는 참고 자료 원문이다.
tools:context
This attribute is typically set on the root element in a layout XML file, and records which activity the layout is associated with (at designtime, since obviously a layout can be used by more than one layout). This will for example be used by the layout editor to guess a default theme, since themes are defined in the Manifest and are associated with activities, not layouts. You can use the same dot prefix as in manifests to just specify the activity class without the full application package name as a prefix.
'Programming Study > Android' 카테고리의 다른 글
[Android] xml에서 question mark(?), 물음표의 의미 (0) | 2015.08.02 |
---|---|
[Android] xml에서 xmlns:android=“http://schemas.android.com/apk/res/android” 의 의미 (0) | 2015.08.01 |