https://kotlinlang.org logo
Title
s

scruffyfox

08/03/2017, 1:28 PM
anyone here used
ViewModel
with
AsyncTask
to update UI and handle config-changes?
b

bachhuberdesign

08/03/2017, 2:13 PM
Out of curiosity, why are you using AsyncTask instead of RxJava or LiveData?
s

scruffyfox

08/03/2017, 2:37 PM
I dont use RxJava and i havent yet used LiveData
b

bachhuberdesign

08/03/2017, 2:43 PM
If you’re using the
ViewModel
from Architecture Components you should look into using LiveData… it’s not too hard to learn and it will make your life much much easier in the long run (and your code cleaner!)
s

scruffyfox

08/03/2017, 2:44 PM
ive been trying to find examples (w/o rx) but theres not a great deal of decent examples that i could find
n

nounours

08/03/2017, 3:43 PM
Looks heavy for a small task 😕 There are other approach which seem better (LiveData is the easiest to implement I think)