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..
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));
 
    
    Is deprecated
getResources().<strike>getDrawable</strike>(R.drawable.myimage));
Now:
image.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.menu_southamerica));
 
    
     
    
    You don't say, but I'm guessing a null pointer exception. Make sure that hpdown is not null before you call setImageResource.
 
    
    Something tells me that your issue is that your resource is: R.drawable.haie2 which to me, in the context of your code, looks like it's a spelling mistake that is supposed to be R.drawable.hair2
