code4romania / mon-vot-android-kotlin

Android election monitoring app - a mobile app through which commissioned observers can easily report back to their respective NGOs throughout the election day
https://votemonitor.org
Mozilla Public License 2.0
7 stars 29 forks source link

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

Open catalin-florescu opened 4 years ago

catalin-florescu commented 4 years ago

image 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) {...} }

pedrofsn commented 4 years ago

I've tried to fix this #226

pedrofsn commented 3 years ago

I've updated code, now it's running. Please, take a look in #226 again.