private int ServiceLeft;
private int ServiceRight;
private int Services;
final TextView countTextViewPlusL = (TextView) findViewById(R.id.TextViewCountL);
final Button ServiceButtonLeft = (Button) findViewById(R.id.ButtonServiceLeft);
final TextView countTextViewPlusR = (TextView) findViewById(R.id.TextViewCountR);
final Button ServiceButtonRight = (Button) findViewById(R.id.ButtonServiceRight);
View.OnClickListener listner = new View.OnClickListener() {
public void onClick(View v) {
switch(v.getId()) {
case R.id.ButtonServiceRight:
ServiceRight++;
break;
case R.id.ButtonServiceLeft:
ServiceLeft++;
break;
}
if(Services % 2 == 0) {
getDrawable(R.drawable.test);
}
}
};
i get an error on "getDrawable"
getDrawable(R.drawable.test);
it says: The method getDrawable(int) is undefined for the type new View.OnClickListener(){}.
how to solve this?
Try this :
MyActivity.this.getResources().getDrawable(R.id.test);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With