AsyncTask Deprecated in Android | Executor Service in Java | Dr Vipin Classes

preview_player
Показать описание
AsyncTask Deprecated Alternative | AsyncTask Deprecated by Executor Service in Java

About this video:
In this video, I explained about the following topics:
1. What is executors?
2. How to use executor service in place of AsyncTask class?

#android, #androidstudio, #drvipinclasses

My Other Playlists
1. Data Structure using Golang

2. Web Development using Golang

3. Go / Golang Tutorials

4. Kotlin Android Tutorials

5. Spring Boot Tutorials

6. Spring Framework

7. JavaScript ES 6

8. Java Features

9. Seaborn Python

10. Firebase with Kotlin

11. Kotlin Android Jetpack Library & MVVM

12. Kotlin SQLite and ROOM API Tutorials

13. Java Tutorials

14. MongoDB for Beginners

15. Java Multi-Threading

16. Java File Handling

17. Node JS for Beginners

18. Kotlin for Beginners
Рекомендации по теме
Комментарии
Автор

Thank You for trying ExecutorServices. You almost got how they work.
Still I need to add that You need to shutdown() on thread pool, or it will leak system resources. Maybe in Your simple sample it's ok, but still, it looks like malloc without free in C++.
And more important that You should not create thread pool every time, but do it just once. You don't need to create thread pool every mouse click. Please create a pool in onCreate() and call shutdown() on pool in onDestroy(). Other comment said about don't need runonuithread() twice, but I think it does not matter for the test.

AngryPacman
Автор

simple and fast explanation. Thank you very much

isown
Автор

Thank you for this clear explanation - it made conversion from AsyncTask easy!

SnookDgg
Автор

Top good job sir, very nice solution instead of RXjava.

javaman
Автор

Thanks for this I could barely understand other videos

trendsonly
Автор

Thanks sir.. this solved my problem...

yusufmustari
Автор

Can you show the onProgress () methods of AsyncTask in ExecutorService and also to destroy when moving to another activity

m.e.ssofttech
Автор

Thank you for the video. Can we use Thread instead of ExecutorService?
new Thread(() -> {
//do work here
}).start();

sujith
Автор

Why are we using 2 runOnUIThread method, Why don't we use any callbacks ....bcs use of runOnUIThread multiple time on the same Thread is not a good approach

kartiksharma-flxd
Автор

I applied on my code. But its not working. when you try to debug, That methods and Executors are not working.

ravincristiano