问题
I register receiver in onResume()
and unregister it in onPause()
method. I can strange error in my Crashlytics reports:
Fatal Exception: java.lang.RuntimeException
Unable to pause activity {package-here}: java.lang.IllegalArgumentException: Receiver not registered:
Caused by java.lang.IllegalArgumentException
Receiver not registered:
It happened 3 times (3 users) on 20k installs.
Is it possible that onPause() gets called if onResume() hasn't been called before? I thought it isn't.
回答1:
If it is Samsung device then yes, it is possible: https://issuetracker.google.com/issues/37001269#c3
回答2:
If you open and close the app too often(Multiple times in 1 second),it will happen
来源:https://stackoverflow.com/questions/50326274/is-it-possible-that-onpause-gets-called-if-onresume-hasnt-been-called-befor