-1

Click Event

public void buttonOnClick(View v) {
Button button=(Button) v;
((Button) v).setText("clicked");

Changes BackGround to an image

RelativeLayout rl = (RelativeLayout) findViewById(R.id.BackGround);
rl.setBackgroundResource(R.drawable.mapwork);

Makes Certain Items Disapear

button.setVisibility(View.INVISIBLE);
EditText mText2 = (EditText) findViewById(R.id.input);
mText2.setVisibility(View.INVISIBLE);

Changes what is in the output if they put in a certain number

EditText mText = (EditText) findViewById(R.id.output);
if("8" == mText.getText().toString()){
    mText.setText("That does not work!");
}
}

When I test the application the If statement never happens even when the requirements are met. I have tried look for an answer and have not found one. Thank you for helping.

Rage1519
  • 1
  • 1

1 Answers1

1

Now it will work

   if(mText.getText().toString().equals("8")){
mText.setText("That does not work!");}
Shahzain ali
  • 1,679
  • 1
  • 20
  • 33