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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:52:30+00:00 2026-06-05T12:52:30+00:00

well am able to validate an edittext when its empty using the below code

  • 0

well am able to validate an edittext when its empty using the below code

EditText a = (EditText) findViewById(R.id.edittext1); 

if ((a.getText().toString().equals(""))
{
    Toast.makeText(getApplicationContext(), "value is empty", 0).show();
}   

the edittext input type is set as number.

now i want to validate the number entered.

for example the range of number to be entered should be between 15 to 25.

if the number is below 15 or above 25 it should show Out of Range

help me out! 🙂

  • 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-05T12:52:31+00:00Added an answer on June 5, 2026 at 12:52 pm

    You can do something like that:

    final int value = Integer.valueOf(a.getText().toString());  
    if (value < 15 || value > 25) {  
        // do what you want  
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to read any well-formed RSS/ATOM file. That would mean
Well, the title pretty much states it. I want to be able to draw
Well, okay. There's Visual Studio 2008 and Embarcadero Delphi/Studio that are both able to
I have a long-standing application that I'm normally able to compile equally well from
I'm working on my first PHP project, and it's going well. I've been able
I have a regex that I am using to validate email addresses. I like
I have a page that uses an AJAX request (using Prototype's Ajax.Request()) to validate
Why i am not able to exceute 2 aysnctask simultaneously, here is the code
I need to validate the below range via regex in javascript. -20.00 to +20.00
Is it possible using one or more XSDs to validate the following xml structure

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.