SuddenH4X / awesome-app-rating

An Android library providing a dialog, which asks the user to rate the app or give feedback. You can also use the library to show the Google in-app review easily under certain conditions.
Apache License 2.0
231 stars 40 forks source link

IllegalStateException #61

Closed inidamleader closed 3 years ago

inidamleader commented 3 years ago

On my crash analytics I get this crash report: Fatal Exception: java.lang.IllegalStateException Can not perform this action after onSaveInstanceState

androidx.fragment.app.FragmentManager.checkStateLoss (FragmentManager.java:1844) androidx.fragment.app.DialogFragment.show (DialogFragment.java:260) com.suddenh4x.ratingdialog.AppRating$Builder.showNow (AppRating.java:309) com.suddenh4x.ratingdialog.AppRating$Builder.showIfMeetsConditions (AppRating.java:328) com.inidamleader.ovtracker.reviewer.AppRatingReviewer.launchReviewFlow (AppRatingReviewer.java:63) com.inidamleader.ovtracker.reviewer.ReviewerImpl.launchReviewFlowIfPossible (ReviewerImpl.java:40) com.inidamleader.ovtracker.activity.MainActivity$onCreate$initReviewers$1.invokeSuspend (MainActivity.java:209) kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (BaseContinuationImpl.java:33) kotlinx.coroutines.DispatchedTaskKt.resume (DispatchedTaskKt.java:227) kotlinx.coroutines.DispatchedTaskKt.dispatch (DispatchedTaskKt.java:166) kotlinx.coroutines.CancellableContinuationImpl.dispatchResume (CancellableContinuationImpl.java:362) kotlinx.coroutines.CancellableContinuationImpl.resumeImpl (CancellableContinuationImpl.java:396) kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default (CancellableContinuationImpl.java:388) kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched (CancellableContinuationImpl.java:484) kotlinx.coroutines.android.HandlerContext$scheduleResumeAfterDelay$$inlined$Runnable$1.run (HandlerContext.java:19)

SuddenH4X commented 3 years ago

Hi @inidamleader, can you share some more information regarding this issue? How and when do you call the library?

inidamleader commented 3 years ago

On my app, that was a bug caused by differed showing the FragmentDialog after 15s after launching the application when the activity is not resumed. Read this to understand what happened: https://medium.com/@alvaro.blanco/avoiding-illegalstateexception-for-dialogfragments-6a8f31c4ce73