The Material Time Picker component crashes on Android during app background/foreground cycle
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- android, javascript, react-native
- Área
- mobile
Línea de trabajo
Start by tracing the Android Material time picker flow in RNMaterialTimePicker.kt and MaterialTimePickerModule.kt, especially the show call in the stack trace and how opening is scheduled. Reproduce the background/foreground interruption on Android with the provided steps. Done means returning to the app after interrupting the dialog no longer crashes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug report
Summary
Using the Material Design time picker in my Android app causes a crash when the user switches to another app or locks the device while the time picker dialog is opening or open, and then go back to my app.
Expected Behavior:
The app should resume gracefully without crashing, even if the time picker dialog was interrupted or not fully shown.
Actual Behavior:
The app crashes when returning from background after attempting to open the time picker.
Steps to reproduce
- I open a screen with the time picker
- I tap a button that opens the time picker
- I press the home button before the picker fully appears
- When I return to my app, it crashes
Code -
const DateTimePicker: React.FC<DateTimePickerProps> = ({
testID,
value,
mode,
display,
onChange,
style,
minimumDate,
maximumDate,
is24Hour = false,
androidProps = {},
}) => {
const {title, positiveButton, negativeButton} = androidProps;
return (
<View style={styles.container}>
<DateTimeSelector
testID={testID}
value={value}
mode={mode}
display={display}
design="material"
onChange={onChange}
title={title}
positiveButton={positiveButton}
negativeButton={negativeButton}
style={style}
minimumDate={minimumDate}
maximumDate={maximumDate}
is24Hour={is24Hour}
/>
</View>
);
};
now I'm using above component as in our app screen ->
<DateTimePicker
testID={'DATE_TIME_PICKER'}
value={get.selectedDate}
mode="time"
display={get.isAndroid ? 'clock' : 'spinner'}
maximumDate={get.maximumDate}
onChange={set.handleTimeChange}
is24Hour={get.is24HourFormat}
style={styles.dateTimePicker}
androidProps={{
title: t('selectTime'),
positiveButton: {label: t('Button.ok')},
negativeButton: {label: t('Button.cancel')},
}}
/>
Error
androidx.fragment.app.BackStackRecord.commitInternal (BackStackRecord.java:341)
androidx.fragment.app.BackStackRecord.commit (BackStackRecord.java:306)
androidx.fragment.app.DialogFragment.show (DialogFragment.java:507)
com.reactcommunity.rndatetimepicker.RNMaterialTimePicker.show (RNMaterialTimePicker.kt:109)
com.reactcommunity.rndatetimepicker.RNMaterialTimePicker.open (RNMaterialTimePicker.kt:29)
com.reactcommunity.rndatetimepicker.MaterialTimePickerModule.open$lambda$0 (MaterialTimePickerModule.kt:46)
com.reactcommunity.rndatetimepicker.MaterialTimePickerModule.$r8$lambda$Fd7Bz8i6zmNahyMJIHFgC8wqsHw
com.reactcommunity.rndatetimepicker.MaterialTimePickerModule$$ExternalSyntheticLambda0.run (D8$$SyntheticClass)
android.os.Handler.handleCallback (Handler.java:958)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loopOnce (Looper.java:230)
android.os.Looper.loop (Looper.java:319)
Environment
- @react-native-community/datetimepicker: 8.4.1
- React Native: v0.76.6
- Android: 14
- Lenguaje dominante
- JavaScript
- Estrellas
- 2.9k
- Forks
- 459
- Merge medio
- 4 d 16 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de react-native-datetimepicker/datetimepicker
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
react-native-datetimepicker/datetimepicker#1070 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
-
DateTimePickerAndroid.open() throws "Cannot read property" error on RN 0.78.3 new architectureAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
react-native-datetimepicker/datetimepicker#1047 · 6 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
react-native-datetimepicker/datetimepicker#1046 · 1 comentario ·
Todos los issues de react-native-datetimepicker/datetimepicker
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 87/100
OWASP/CheatSheetSeries#2905 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ComposioHQ/composio#5249 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
zilliztech/memsearch#838 ·
Los mantenedores suelen responder en 1 día
-
[DOCS] Nine one-colon directives hide code examples and notes in the reference docs (e.g. CustomJS)AbiertoTRIAGE
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
cdx-audit output written to a pipe is cut off at 64 KiBQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertobug mode:cli
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día