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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -