Skip to content Skip to sidebar Skip to footer

Android - Registering A Broadcast Receiver For Two Intents?

I was wondering is it possible to register a broadcast receiver to receive two intents? My code is as follows: sipRegistrationListener = new BroadcastReceiver(){ @Override

Solution 1:

Don't create your IntentFilter inline, then use the addAction method to add the UNREGISTERED action, i.e.:

IntentFilter filter = new IntentFilter(SIPEngine.SIP_REGISTERED_INTENT);
filter.addAction(SIPEngine.SIP_UNREGISTERED_INTENT);
context.registerReceiver(sipRegistrationListener, filter);

Post a Comment for "Android - Registering A Broadcast Receiver For Two Intents?"