broadcastreceiver - How to limit broadcast to its own Android app -
i wondering if possible create private broadcast. register broadcastreceiver in activity , use
sendorderedbroadcast(broadcast);
method send broadcast. but, now, intent (broadcast) used method defined :
intent broadcast = new intent("com.mypackage.broadcast");
so every external application declare package name can listen sending, , don't want to.
so how make impossible, no 1 can listen broadcast ?
i think looking localbroadcast manager. docs say:
it helper register , send broadcasts of intents local objects within process. has number of advantages on sending global broadcasts sendbroadcast(intent). 1 of them data broadcasting won't leave app, don't need worry leaking private data.`
see how use localbroadcastmanager? more. hope helps you.
Comments
Post a Comment