michaldrabik / classicmaterialtimepicker

Classic Material Time Picker
57 stars 10 forks source link

using architecture components along with this libary causes issues in lifecycle #4

Closed RodoIndia closed 3 years ago

RodoIndia commented 5 years ago

When we use architecture components with this library, a lifecycle issue arises. ViewModel no longer accepts activity context as a lifecycle owner.

chatEvent.outgoingChat.observe(this, Observer {

})

The above code doesn't accept context as a lifecycle owner when using this library but when I remove the library, it works perfectly.

michaldrabik commented 5 years ago

Hello. I suppose this in above code should be an Activity? Does your activity extends AppCompatActivty? Can you share your gradle dependencies for Android ViewModel

Regards