I working on a library project and I'm facing some "issues", I don't have setup Dagger, RX or any of these things for now because I try to face the problem that should put me on this way
First is : In this project I have a BroadcastReceiver class that work well, but this broadcast receiver is register and unregister by me into onStart()
and onStop()
method of my demo activity
```override fun onStart() {
super.onStart()
registerReceiver(myReceiver, IntentFilter(TOTO))
}
override fun onStop() {
super.onStop()
unregisterReceiver(myReceiver)
}```
Second is : In this project I also have an IntentService, that the user can start and also bind to communicate with, but I also do the unbind()
action into a lifecycle method
but I don't want to force the user to do that for each of activities that implement my library, so I think about a solution : Create an Activity that should be override to already implement all this lifecycle stuff
But i'm wondering if with AAC and all Fancy Lib we use these day, if there is a way to do that more cleanly ? ( Like using LiveData or I don't know )
Thanks you a lot for reading me and maybe participate to the discussion :)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…