Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internal broadcasts in android

Is possible to launch broadcast with application scope? That is: broadcasts undetectable out of the application?

I was using broadcast for communicate some events to the UI. But recently I recycled some of my code for another app and I found that the broadcasts were awakening both applications (as it was expected). So I wonder if there is any way around this besides changing the value of "action" of Intent

like image 527
Addev Avatar asked Dec 22 '22 07:12

Addev


1 Answers

You should use LocalBroadcastManager, its best alternative to normal broadcast, if you want intra application message passing. Read this post for implementation: how to use LocalBroadcastManager?.

like image 50
SohailAziz Avatar answered Dec 28 '22 11:12

SohailAziz