How to catch lifecycle events with ProcessLifecycleOwner?

后端 未结 1 1048
我寻月下人不归
我寻月下人不归 2021-01-18 22:51

I am trying to (at least partially) determine when an application gets closed by the user to release some connections, etc. To do this, I am using the ProcessLifecycle

相关标签:
1条回答
  • 2021-01-18 23:38

    You need the corresponding annotation processor to pay attention to those annotations:

    annotationProcessor 'android.arch.lifecycle:compiler:1.1.1'
    

    Or, enable Java 8 support, and switch to DefaultLifecycleObserver.

    0 讨论(0)
提交回复
热议问题