23

반응형


Android API 23 에서 바뀐 부분이 있나보다

코드에서 getDrawable 부분에서

  'getDrawable(int)' is deprecated more...

이게 발생했다.

수정 방법은 다음과 같았다

기존 코드

img_season = (BitmapDrawable)context.getResources().getDrawable(getMap().get(str_season));


수정 코드

img_season = (BitmapDrawable) ContextCompat.getDrawable(context, getMap().get(str_season));



ContextCompat 를 추가하고 나서 아래 사진처럼 뜨는데 Alt + Enter를 해주면 정상적으로 적용된다.




반응형

+ Recent posts