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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:53:40+00:00 2026-06-11T05:53:40+00:00

I am encountering a problem for my application. I am trying to do something

  • 0

I am encountering a problem for my application. I am trying to do something to prevent the user from selecting the date and time that has already past. If the user selects date and the time that has past, an error message will be displayed. The user will be selecting the date and time from the datePicker and timePicker. Anyone have any idea on doing it? Any help will be greatly appreciated. Thanks a lot!

  • 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-11T05:53:42+00:00Added an answer on June 11, 2026 at 5:53 am

    If you’re setting the picker value in edittext, you can do this:

    Calendar cal = Calendar.getInstance();
                                    cal.set(cal.get(Calendar.YEAR),
                                            cal.get(Calendar.MONTH),
                                            cal.get(Calendar.DAY_OF_MONTH));
                                    DateFormat df = new SimpleDateFormat(
                                            "dd/MM/yyyy");
                                    Date day_entered, day_valid;
    
                                    day_entered = df.parse(your_date_edittext.getText()
                                            .toString());
                                    day_valid = df.parse(df.format(cal.getTime()));
                                    if (day_entered.after(day_valid)) {
                                        Toast msg = Toast
                                                .makeText(
                                                        Profile.this,
                                                        "Please Enter a valid date",
                                                        Toast.LENGTH_LONG);
                                        msg.show();
                                        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I´m encountering this problem trying to mock some objects that receive complex lambda expressions
I am encountering a problem with passing data between pages that require facebook access.
I am encountering a problem with string formatting while trying to get only the
I'm encountering a problem trying to generalize my algorithm for any-size problems. The code
Still programming an iPad game in Actionscript 3, I am encountering a problem that
The problem I am encountering is that for my login form I have to
I'm encountering a problem generating my client and server code from wsdl. I've been
We're porting an application from Tru64 to SLES11 and the part that I'm working
I'm trying to create a Windows Form application that searches for a string and
I am encountering a very strange problem in my wxWidgets application. What I am

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.