에 글고의 배경 색상을 얻기 위해 어떻게 내가 setBackgroundColor하여 설정할 수 있습니다, 글고의 색상을 좀하고 싶습니다,하지만 난이안드로이드
EditText edtxt;
edtxt.setBackgroundColor(Color.GREEN);
PaintDrawable drawable;
Log.d(TAG,"1");
drawable = (PaintDrawable)edtxt.getBackground();
if(drawable.getPaint().getColor()==(int)Color.GREEN).........
Log.d(TAG,"2");
하지만 발견 getBackgroundColor 기능
이 아니다 일하는 당신이 편집 텍스트의 배경색 인 알 (예를 들어 부울) 플래그의 어떤 종류를 저장하는 것이 더있을 수 런타임의 색상을 설정하는 경우
05-29 19:20:27.526: E/AndroidRuntime(20255): Caused by: java.lang.ClassCastException: android.graphics.drawable.StateListDrawable cannot be cast to android.graphics.drawable.PaintDrawable
왜 그렇게 할 것으로 변경됩니다? –