I get a force close on this
if(num1.getText().equals("0")) {
num1.setText("1");
ImageView hpdown1 = (ImageView)findViewById(R.id.hair);
hpdown1.setImageResource(R.drawable.haie2);
}
Please help..
You can use getDrawable method from Resources class. For example :
ImageView image = (ImageView) findViewById(R.id.image);
Resources res = getResources(); /** from an Activity */
image.setImageDrawable(res.getDrawable(R.drawable.myimage));
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