Answer the question
In order to leave comments, you need to log in
Choosing a multithreading solution in Android?
I learned from one course that using Thread and ASyncTask causes a memory leak and you need to use rxJava.
What other pros/cons are there? What about kotlin coroutines?
Answer the question
In order to leave comments, you need to log in
ASyncTask, as far as I know, queues the execution of tasks, so ASyncTask is not suitable for too long. While there is a method to run tasks in parallel, I wouldn't use it at all.
Memory leaks are specifically caused not by Thread and ASyncTask, but not by the correct work with objects. In addition, you can use weak references weakreference - which will allow you to remove an object from memory without considering this reference.
If you choose from Thread and ASyncTask - then I tend to Thread.
rxJava is just a library, besides, if you work with references (objects) incorrectly, a memory leak is also possible.
PS I'm a newbie like you so I could be wrong.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question