firetech/PactrackDroid

RefreshDialog can be recreated by the system

Closed this issue · 0 comments

In some cases, it seems that a RefreshDialog can be recreated by the Android system despite setRetainInstance(true). Seen on an LG G3 in a Play Store report. This makes it throw an IllegalStateException("RefreshDialog.initValues() has not been called."). However even if a recreation would succeed, the ProgressHandler pointer it sent out before would not be valid, and the dialog would be useless.

A workaround would be to immediately hide the Dialog in that case. Either by changing the IllegalStateException to a warning in the log followed by return null (unsure if that would work) or by dismissing the dialog directly if recreated (mHandler == null).