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 8085483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:08:00+00:00 2026-06-05T18:08:00+00:00

I have 3 edittexts with input type as number and 1 button that say

  • 0

I have 3 edittexts with input type as number and 1 button that say Done

I have to check two conditions for the values entered in the edittexts

When I click on the button Done I should be able to do thee following things

—-First is to check if the edit texts are empty or not

if ((a.getText().toString().equals("")) || (b.getText().toString().equals("")) || (c.getText().toString().equals("")))
    Toast.makeText(getApplicationContext(), "Don't leave grade points empty",0).show();

—-Second is to check if the values entered are within a certain range

if((a1<5 || a1>10)||(b1<5 || b1>10)||(c1<5 || c1>10))
    Toast.makeText(getApplicationContext(), "Range should be between 15 to 25", 0).show();

both a,b,c and a1,b1,c1 represent the same values, i’ve just parsed the values of a,b,c to int in a1,b1,c1

—-Then in the else part I should be able to use these values if they pass the above conditions.

else
{
//do something
}

My problem is how to make it work as I face a Force close error on clicking the Done button when all 3 edittext are empty. I tried to put those in if, else if and else loop and also tried if,if and else loop.

How should I code that if it doesn’t satisfy both the conditions and then go to the else part?

Help !! 🙂

  • 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-06-05T18:08:02+00:00Added an answer on June 5, 2026 at 6:08 pm
    if ((a.getText().toString().equals("")) || (b.getText().toString().equals("")) || (c.getText().toString().equals("")))
        Toast.makeText(getApplicationContext(), "Don't leave grade points empty",0).show();
    else {
        //Convert your a/b/c.getText() to a1/b1/c1 now you know they are not empty
        if((a1<5 || a1>10)||(b1<5 || b1>10)||(c1<5 || c1>10))
            Toast.makeText(getApplicationContext(), "Range should be between 15 to 25", 0).show();
        else
        {
        //do something
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a edit text, whose input type is number. in emulator its working
I have two EditTexts in XML. In one EditText, the user can put a
I have a database that is being filled by user defined EditTexts. None of
I have set input type to be numberdecimal but also want to populate the
I have been trying to accept two values, 1) inpval2 and 2) rate, through
I have successfully created EditTexts depending on the user input in Android, and also
I have an input form that has 38 fields I know it's too much
I have an activity with style Dialog, containing two EditTexts. However, only the first
I have an EditText input that I would like to only allow numbers 1
I have a bunch of EditTexts in my Android application, each with InputMethod set

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.