F
F
foonfyrick2020-09-18 08:47:13
Android
foonfyrick, 2020-09-18 08:47:13

LiveData how to specify observable object?

LiveData liveData = ExampleClass.getInstance().getData();
Why does not it work? getInstance() no

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri, 2020-09-18
@foonfyrick

LiveData liveData = (new MutableLiveData()).getData();

A
Alina Mitrokhina, 2020-09-18
@fursa08

val yourData = ExampleClass.getInstance().getData()
val liveData = MutableLiveData(yourData)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question