material-components / material-components/material-components-android

[MaterialTimePicker] Hour incorrectly restored in 24 hour time format after process death

Open
#3,160 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Widget: TimePicker
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Description:** When triggering process death with a MaterialTimePicker dialog opened, with 24 hour time format, the dialog is incorrectly recreated. If the time "8:00" was selected, "20:00" will be shown instead after recreation. Weirdly enough, "8" is still selected on the hour wheel. This only happens if the time was set before 12 AM.

Video:

[demo.zip](https://github.com/material-components/material-components-android/files/10314955/demo.zip)

**Expected behavior:** Update the hour display correctly after process death.

**Source code:** Open any MaterialTimePicker with time format set to 24h, then trigger process death. Only library code runs on recreation, none of mine.

**Android API version:** 33

**Material Library version:** 1.7.0

**Device:** emulator

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided demo.zip using MaterialTimePicker in 24-hour mode, then inspect the picker’s process-death recreation and state-restoration path. Done means that a pre-12 AM selection such as 8:00 is displayed as 8:00, with the hour wheel and display remaining consistent after recreation.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.