I ran my code and in eclipse in the log it is showing under text the output as what my else statement is set to. I do not see this text on the screen.
I am trying to compare a number to a number in my if statement.
I have stated PleaseEnter as android:inputType=”number” in the layout. I have included some of the ways that I have tried to change my if statement to compare the values.
I need help with
1. Having if statement validated to show what it needs to and
2. Have the output show on the screen.
try
PleaseEnter=(EditText)findViewById(R.id.PleaseEnter);
{
if ("1".equals(PleaseEnter))
//(PleaseEnter.getText().equals("1"))
//(PleaseEnter.equals("1"))
{
// tv.setText("This is the display 1");
System.out.println("This is 1");
}
else if (PleaseEnter.equals("2"))
System.out.println("This 2");
else if (PleaseEnter.equals("3"))
System.out.println("This 3");
else
System.out.println("That number is not recognized.");
}}
catch (Exception ex)
try this: