0

I have two activity. Cores and MudaCor. In Cores i have four buttons, selecting anything here tries to changes button color from MudaCor and start it, but the Android Emulator tell me "Error on App."

public class MudaCor extends AppCompatActivity { 
    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
        super.onCreate(savedInstanceState); 
        setContentView(R.layout.activity_muda_cor); 
    } 
}

    btnVermelho.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {

            img1.setBackgroundColor(getResources().getColor(corVerde));
            img2.setBackgroundColor(getResources().getColor(corVerde));
            img3.setBackgroundColor(getResources().getColor(corVerde));
            img4.setBackgroundColor(getResources().getColor(corVerde));

            Intent intent = new Intent(Cores.this, MudaCor.class);
            startActivity(intent);
        }
    });
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Goji Berry
  • 61
  • 1
  • 1
  • 5

0 Answers0