R 클래스 객체와 android.R 클래스의 차이는 무업입니까?

참조 : https://stackoverflow.com/questions/16996600/diferrence-between-r-android-r-class

안드로이드에는 R 클래스가 객체를 sta­t­ic 으로 제공한다.
R.java 객체는 안드로이드 리소스(레이아웃, 이미지, 문자열 등)를 식별하기 위한 변수들을 관리하는 R 클래스이다.
예를 들어 res/drawable 경로에 test.jpg 파일을 추가하면 R.java에는 test 객체가 자동으로 생성되어
다른 자바코드에서 “R.test“으로 해당 이미지 리소스를 참조할 수 있게 된다.

그러면 안드로이드에 사용한느 android.R.파일명 은 무엇일까?
Stack­over­flow 에서 그 답을 찾을 수 있었다.

R.layout.*, R.id.*,in fact any R.something with­out the android.- part in front of it refers to some resource in your resources fold­ers, e.g. draw­ables, strings, lay­outs, ids of wid­gets etc. android.R.* refers to stan­dard android items that come shipped with your SDK

R.layout.*, R.id.* 객체들은 리소스 폴더를 참조한다. 그러나 android.R.* 은 SDK가 지니고 있는 안드로이드 아이템을 참조한다.

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다