esafirm / conductor-extra

Extra niceties for Conductor
MIT License
1 stars 0 forks source link

addLifecycleCallback error if finishActivity() or onBackPressed on Top Of Controller #4

Open derohimat opened 6 years ago

derohimat commented 6 years ago

java.lang.RuntimeException: Unable to destroy activity {.MainActivity}: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter view at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4383) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4401) at android.app.ActivityThread.-wrap5(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter view at com.esafirm.conductorextra.ControllerExtKt$addLifecycleCallback$listener$1.preDetach(Unknown Source:9) at com.bluelinelabs.conductor.Controller.detach(Controller.java:918) at com.bluelinelabs.conductor.Controller.destroy(Controller.java:1099) at com.bluelinelabs.conductor.Controller.activityDestroyed(Controller.java:859) at com.bluelinelabs.conductor.Router.onActivityDestroyed(Router.java:567) at com.bluelinelabs.conductor.ActivityHostedRouter.onActivityDestroyed(ActivityHostedRouter.java:61) at com.bluelinelabs.conductor.internal.LifecycleHandler.destroyRouters(LifecycleHandler.java:209) at com.bluelinelabs.conductor.internal.LifecycleHandler.onDestroy(LifecycleHandler.java:160) at android.app.Fragment.performDestroy(Fragment.java:2768) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1432) at android.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1557) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1618) at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3023) at android.app.FragmentManagerImpl.dispatchDestroy(FragmentManager.java:3007) at android.app.FragmentController.dispatchDestroy(FragmentController.java:244) at android.app.Activity.performDestroy(Activity.java:7208) at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1249) at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4370) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4401)  at android.app.ActivityThread.-wrap5(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6494)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 

esafirm commented 6 years ago

@derohimat ah i think this is because the View in addLifecycleCallback is non nullable. Can you provide the step by step to reproduce it? Thanks!

derohimat commented 6 years ago

@esafirm step for reproduce

try to call finishActivity() from your Controller, or press back button on top of your controller

I always get that error