code4romania / code4romania/mon-vot-android-kotlin
[Bug] ProgressDialogFragment crash the app when fast switching to fragments
- Dominant language
- Kotlin
- Stars
- 7
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Description

Using `DialogFragment` or `ProgressDialog` could lead to crash if is trying to show when fragment is not attached or shown.
As a fast solve you could check if the fragment is added
`override fun onPageFinished() {
if (isAdded)
progressDialog.dismiss()
}`
`override fun onLoading() {
if (isAdded && !progressDialog.isResumed) {...}
}`
Contributor guide
Research direction
Start by locating ProgressDialogFragment and its onPageFinished() and onLoading() callbacks. Reproduce rapid switching between fragments, then verify that showing or dismissing the progress dialog no longer crashes when the fragment is unattached or not shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100