code4romania / code4romania/mon-vot-android-kotlin

[Bug] ProgressDialogFragment crash the app when fast switching to fragments

Open
#177 2 comments 0 reactions 0 assignees View on GitHub
autumn-2020 bug
Dominant language
Kotlin
Stars
7
Forks
26
PR merge metrics
No merged PRs in 30d

Description

![image](https://user-images.githubusercontent.com/7399214/69948171-d1597580-14f7-11ea-861f-4b7ef29d89eb.png)
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.