Android

BroadcastReceiver Tutorial Part 5 – ORDERED BROADCASTS – Android Studio Tutorial

In part 5 of the BroadcastReceiver tutorial, we will learn how to send and receive ordered broadcasts. Ordered broadcasts are sent to each registered BroadcastReceiver sequentially, and we can control the order in which the receivers are triggered by setting a priority on their intent filters. For statically registered receivers we use the android:priority attribute on the intent-filter tag, and for dynamically registered receivers we use the setPriority method on the IntentFilter object. BroadcastReceivers with higher priority will receive the broadcast before receivers with lower priority.
Together with the broadcast we can send a resultCode integer, a resultData String and a resultExtras Bundle. Each receiver can receive this data, make changes to it, forward it to the next receiver, or completely cancel the broadcast by calling abortBroadcast.
In the sendOrderedBroadcast method we can also specify a resultReceiver, which will be triggered at the very end of the broadcast.

Watch the whole playlist:

Example code for this part:
https://gist.github.com/codinginflow/5104c2c0514dad15eb64dad62988db07

____________________
💻 Find the BEST programming tutorials on TutHub:
https://tuthub.io

⭐ Get my MVVM Caching Course now:
https://codinginflow.com/caching

❗ Subscribe to the channel:
https://www.youtube.com/c/codinginflo…

📨 Subscribe to the Coding in Flow newsletter:
https://codinginflow.com/newsletter

❓ Join our free developer community:
https://discord.gg/TSnMvmc

📣 Follow Coding in Flow on other sites:
Facebook: https://www.facebook.com/codinginflow
Instagram: https://www.instagram.com/codinginflow
TikTok: https://www.tiktok.com/@codinginflow
Twitter: https://twitter.com/codinginflow
Github: https://github.com/codinginflow

💰 Business requests, sponsoring, etc.: info@codinginflow.com

Views :17035
android studio

Source by Coding in Flow

Mourad ELGORMA

Fondateur de summarynetworks, passionné des nouvelles technologies et des métiers de Réseautique , Master en réseaux et système de télécommunications. ,j’ai affaire à Pascal, Delphi, Java, MATLAB, php …Connaissance du protocole TCP / IP, des applications Ethernet, des WLAN …Planification, installation et dépannage de problèmes de réseau informatique……Installez, configurez et dépannez les périphériques Cisco IOS. Surveillez les performances du réseau et isolez les défaillances du réseau. VLANs, protocoles de routage (RIPv2, EIGRP, OSPF.)…..Manipuler des systèmes embarqués (matériel et logiciel ex: Beaglebone Black)…Linux (Ubuntu, kali, serveur Mandriva Fedora, …). Microsoft (Windows, Windows Server 2003). ……Paquet tracer, GNS3, VMware Workstation, Virtual Box, Filezilla (client / serveur), EasyPhp, serveur Wamp,Le système de gestion WORDPRESS………Installation des caméras de surveillance ( technologie hikvision DVR………..). ,

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *