我正在尝试为 cwac 混色器(https://github.com/commonsguy/cwac-colormixer)实现获取颜色方法,但是每次运行此代码时,我都会得到NullPointerException
:
int color = 1;
public void openColor(){
ColorMixer mixer = (ColorMixer)findViewById(R.id.mixer);
if (color!=1){
mixer.setColor(color);
}
color = mixer.getColor();
}
color = mixer.getColor();
是崩溃的线。