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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:25:30+00:00 2026-05-26T15:25:30+00:00

I wrote a custom PreferenceDialog that includes two TimePickers, an EditText, a few CheckBoxes,

  • 0

I wrote a custom PreferenceDialog that includes two TimePickers, an EditText, a few CheckBoxes, and a scrollview parent.

Everything works fine, but when the screen orientation changes the timepickers reset to 0 while the other controls retain their state. The values returned by getCurrentHour and getCurrentMinute are the expected values even after the orientation change.

If you scroll up and down the timepickers will eventually redraw and display the correct numbers. Also, if you manually change from 24 hour format to 12 hour format (or vice versa) the timepickers will display the correct value.

Does anyone have an idea on what’s going on?

  • 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-26T15:25:31+00:00Added an answer on May 26, 2026 at 3:25 pm

    FINALLY figured it out. If you’re using a TimePicker within a DialogPreference all you have to do is override the showDialog method and set the currentHour and currentMinute there.

    Like this:

    @Override
    protected void showDialog(Bundle state) {
        super.showDialog(state);
    
        mBeginShiftTp.setCurrentHour(mBeginShiftTp.getCurrentHour());
        mBeginShiftTp.setCurrentMinute(mBeginShiftTp.getCurrentMinute());
        mEndShiftTp.setCurrentHour(mEndShiftTp.getCurrentHour());
        mEndShiftTp.setCurrentMinute(mEndShiftTp.getCurrentMinute());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote custom Twig loader that fetch templates from database and it works in
I wrote custom java proposals contributor. It works fine when using Java Proposals advanced
I wrote a custom serializer that works by setting object properties by reflection. Serializable
I wrote a custom web part for SharePoint 2007 that loads an existing user
I have wrote a custom MultipleChoiceField. I have everything working ok but when I
I have a client that is running a custom VB 6 application they wrote
Alright, so I wrote a custom VMR9 Allocator/Presenter which seems to work fine. However,
I wrote a custom server control that inherits from CompositeControl. When the control is
I wrote a custom error handler for my site and I'm aware that PHP
I have rails application that connects to multiple databases. I wrote custom rake task

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.