Android election monitoring app - a mobile app through which commissioned observers can easily report back to their respective NGOs throughout the election day
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) {...} }
Using
DialogFragment
orProgressDialog
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 addedoverride fun onPageFinished() { if (isAdded) progressDialog.dismiss() }
override fun onLoading() { if (isAdded && !progressDialog.isResumed) {...} }