RUVIDEO
Поделитесь видео 🙏

Android S10E2 : Handler - Update ProgressBar From Thread

📁 Обучение 👁️ 16 📅 02.12.2023

Android Handler Tutorial and Example. How to update a progressbar from background thread using Handler class.

SOURCE CODE REFERENCE : http://camposha.info/android/handler-progressbar

In this tutorial we see how to attach a handler to a thread and use the handler to update a progressbar while simulating an intensive tatsk.

This is an android tutorial. We aim to look at the Handler class. This is a very important class defined in the `android.os` package. I have covered Handler in depth with many examples here: http://camposha.info/android/handler. However in this tutorial we look at how to use Handler's post() method to post updates to the user interface. Thus we are able to update the user interface from a background thread. Meanwhile we do the work in the background thread such that the UI thread remains responsive. In this tutorial we are specifically updating a progressbar as we simulate doing work in the background thread.

Here are important links:

VIDEO TUTORIAL : https://youtu.be/zzcRx6wuat8

SOURCE CODE REFERENCE : http://camposha.info/android/handler-...

HANDLER TUTORIAL : http://camposha.info/android/handler

THREAD TUTORIAL : http://camposha.info/android/threading

What is a Handler?

A Handler allows you to send and process Message and Runnable objects associated with a thread's MessageQueue. Each Handler instance is associated with a single thread and that thread's message queue. When you create a new Handler, it is bound to the thread / message queue of the thread that is creating it -- from that point on, it will deliver messages and runnables to that message queue and execute them as they come out of the message queue.

Let's start.

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Android S10E2 : Handler - Update ProgressBar From Thread», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.