Answer the question
In order to leave comments, you need to log in
Data is taken from the page in the Thread, how to wait for data to be received?
Thread(Runnable {
document=Jsoup.connect("......").get()
val elements:Elements=document.getElementsByClass("nbl-slimPosterBlock__title")
elements.forEach {
arrayList1.add(DataCard(it.text()))
}
// здесь размер массива равен 144
}).start()
//здесь размер массива равен 0
Answer the question
In order to leave comments, you need to log in
output array here: // here array size is 144
wrap output in runOnUiThread
read about LIveData and MVVM
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question