I bridged a java module to react native that uses the earphone jack to listen for peripheral devices. The module needs to be destroyed after the app is closed or else it throws NullPointerException when the app is opened again. In its original form, the module is used in an activity and hence the activity's onDestroy method is overridden to destroy the object. In the bridged form, however I use it in a class that extends ReactContextBaseJavaModule
. How do i properly implement onHostDestroy() to destroy this listener when the app is closed.
问问题
1276 次