this is part of my function, android studio isnt recognizing the findViewById function. can anyone please help me figure out the problem is?\
public void onClick(View v) {
p1 = (EditText) findViewById(R.id.p1);
p2 = (EditText) findViewById(R.id.p2);
if (v.getId() == R.id.btnrock) {
if (player1.equals("")) {
player1 = "rock";
if (p1.getText().toString().length() == 0 || p2.getText().toString().length() == 0) {
Toast.makeText(c, "fill both names", Toast.LENGTH_LONG).show();
}
if (p1.getText().toString().equals(p2.getText().toString())&&p2.getText().toString().length()!=0) {
Toast.makeText(c, "use different names", Toast.LENGTH_LONG).show();
}
if (p2.getText().toString().length()!=0)score.setText("now "+ p2.getText());
}
else {
if (player1.equals("rock"))
score.setText("its a tie");
if (player1.equals("paper"))
score.setText(p1.getText() + " won");
if (player1.equals("scissors"))
score.setText(p2.getText() + " won");
if (player1.equals("lizard"))
score.setText(p2.getText() + " won");
if (player1.equals("spock"))
score.setText(p1.getText() + " won");
player1="";
}