I have a service from where i can broadcast using LocalBroadcastManager.
Intent downloadIntent = new Intent();
downloadIntent.setAction(BroadcastActions.DOWNLOAD_APPOINTMENTS.toString());
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(downloadIntent);
In a Test activity i m receiving this broadcasts like following.
IntentFilter filter = new IntentFilter();
filter.addAction(String.valueOf(BroadcastActions.DOWNLOAD_APPOINTMENTS));
filter.addAction(BluetoothDevice.ACTION_FOUND);
LocalBroadcastManager.getInstance(getActivity()).registerReceiver(receiver, filter);
In the same Test activity i added another action called ACTION_FOUND to get bluetooth enabled device. Since i m using LocalBroadCast Manager i couldn't receive broadcast of system if it found any bluetooth devices. Can anybody help on this to receive both system and local broadcasts..?
0 comments:
Post a Comment