Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7538251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:04:36+00:00 2026-05-30T07:04:36+00:00

I ran my code and in eclipse in the log it is showing under

  • 0

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)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:04:37+00:00Added an answer on May 30, 2026 at 7:04 am

    try this:

    if ("1".equals(PleaseEnter.getText().toString().trim())) {
    //your stuffs
    } else .....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got the code from this question, I ran it in Eclipse and the
I ran a Code Analysis and got this message: Warning 5 CA1822 : Microsoft.Performance
I ran the code to create the generically related objects from this demo: http://www.djangoproject.com/documentation/models/generic_relations/
I ran this persons code. It worked as a main but when i put
I'm developing Scala code using Eclipse, often when I run tests I get this
today I ran into this problem which really bugs me, as almost the code
I'm looking at some GXT code for GWT and I ran across this use
Initially I ran this code without the leading cmd and I received an access
I have built a code that does not have errors. It has ran on
My code was clean and ran great until I updated my Eclipse IDE to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.