GAMES PC DOWNLOAD FREE FULL

GAME

The Difference between Handler and AsyncTask

 


After we saw both Handlers and AsyncTasks a question may evolve: what's the difference between the two and when to use one of them over the other ?

The Handler is associated with the application's main thread. it handles and schedules messages and runnables sent from background threads to the app main thread.

AsyncTask provides a simple method to handle background threads in order to update the UI without blocking it by time consuming operations.

The answer is that both can be used to update the UI from background threads, the difference would be in your execution scenario. You may consider using handler it you want to post delayed messages or send messages to the <strong>MessageQueue</strong> in a specific order.

You may consider using AsyncTask if you want to exchange parameters (thus updating UI) between the app main thread and background thread in an easy convinient way.
The Difference between Handler and AsyncTask 4.5 5 Thanh Nguyen After we saw both Handlers and AsyncTasks a question may evolve: what's the difference between the two and when to use one of them over ...


No comments:

Post a Comment

NEW GAME

Powered by Blogger.

Labels

Quotes

1. Những cô gái giống như những tên miền Internet, những tên đẹp mà ta thích đã có chủ nhân rồi!


Popular Posts