I want to get MutableLiveData<List<Country>>()
object from Observable<List<Country>>
, but I'm not able to find a way.
I'm using implementation below, but it's not working. Is there any other way to achieve it, or am I doing something wrong with my current implementation?
dataManagerAnonymous.countries.toList().blockingGet().single()
The above code shows NetworkOnMainThreadException
and crashes the Application.
>. Also you are asking two question with a single post. Your first question is related to type conversion and latter is about threading which is totally different subject. That being said, I believe there are so many questions and answers regarding both questions. It is recommended you research before you ask question. Let's keep the community well organized