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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:15:52+00:00 2026-06-10T15:15:52+00:00

I am planning to block the time picker to a particular start time and

  • 0

I am planning to block the time picker to a particular start time and end Time. For that i am setting TimeChangedListener and overriding onTimeChanged method. below is implementation on the onTimeChanged ().

@Override
public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
// TODO Auto-generated method stub
//;super.onTimeChanged(view, hourOfDay, minute);
 try{
   boolean flag = true;

   if (hourOfDay <= maxHour && hourOfDay >= minHour) {
     if (hourOfDay == maxHour && hourOfDay == minHour) {
       if (minute > maxMin)
          flag = false;
       else if (minute < minMin)
        flag = false;
       else if (minute == maxMin && minute == minMin) {
        flag = false;
       } else if (minute == maxMin) {
          flag = false;
       } else if (minute == minMin) {
          flag = false;
       }
    } else if (hourOfDay == maxHour) {
       if (minute > maxMin)
       {
        flag = false;
       }
    } else if (hourOfDay == minHour) {
       if (minute < minMin)
         flag = false;
    }

   if (flag) {
      curHour = hourOfDay;
      curMin = minute;    
   } else {
      updateTime(curHour, curMin);

   }
 //(curYear, curMonth);
 } else {
    updateTime(curHour, curMin);
 }
//view.updateDate(curYear, curMonth, curDay);
 } catch (Exception e) {
     Log.e("CustomTimePicker","error");
   }
}

but with this code snippet when i reached to minimum time and and trying to decrease minutes time again it going to a continues loop from first

   updateTime(curHour, curMin); 

method call and getting stack overflow exception.bot working fine(like expected) for hours update.
So if some one look at the code snippet and find out the problem please let me know.
any help will be appreciated.

Thanks in Advance.

  • 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-10T15:15:54+00:00Added an answer on June 10, 2026 at 3:15 pm

    I thing it this the problem with the updateTime(curHour, curMin); or onTimeChanged(TimePicker view, int hourOfDay, int minute); method in android OS-v2.3.6 and below. because when i tested the same on a device with android OS-v3.1 and above its working fine. But in OS-v2.3.6 and below when i called updateTime(curHour, curMin); with some 10 mins, onTimeChanged is getting called with 9 mins only. So when i reached to minimum hours after that minimum minutes it going to continues loop.

    So its a but with updateTime(curHour, curMin); or onTimeChanged(TimePicker view, int hourOfDay, int minute); method in android OS-v2.3.6 and below.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm planning to write a simple spaceshooter. I have read that the repaint() method
So I understand that at the end of a using block statement, the dispose
I planning to split my systems into front-end and back-end. Currently my application directly
im planning to create a movie file that might have over 16,000 frames?i know
I'm implementing the Enterprise Library Exception Handling Application Block in an ASP.NET application that
I've got a block of code that's doing what I want - it generates
I am planning a Python script that'll use os.fork() to create a bunch of
I am planning to start learning asp.net mvc. And also I want to learn
I'm planning to deploy an internal app that has sensitive data. I suggested that
I'm in the process of planning an application that would make use of the

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.