getResources().getDrawable() 메소드의 deprecated 대응
              
          CODEDRAGON ㆍDevelopment/Android
반응형
    
    
    
  
getResources().getDrawable() 메소드의 deprecated 대응
· getResources().getDrawable(int id) 메소드는 API 22에서 deprecated 되었습니다.
· getResources().getDrawable(int id) 메소드를 ContextCompat.getDrawable(Context context, int id) 메소드로 대체합니다.
getDrawable() 원형
ContextCompat(android.support.v4.content.ContextCompat) 클래스에 있는 getDrawable()메소드를 사용합니다.
실제 호출방법
| ContextCompat.getDrawable(conext, id); | 
http://codedragon.tistory.com/3207
getDrawable()
https://developer.android.com/reference/android/content/res/Resources.html#getDrawable(int)
'Development > Android' 카테고리의 다른 글
| 안드로이드 화면 구성 (0) | 2020.03.03 | 
|---|---|
| Fragment(프래그먼트) (0) | 2020.02.26 | 
| DDMS(Dalvic Debug Monitor Service) - 디바이스 관리 (0) | 2020.02.13 | 
| LogCat창 표시하기 (0) | 2020.02.08 | 
| Android - 안드로이드 수동 권한 설정하기 (0) | 2020.02.01 |