Questions tagged [android-broadcastreceiver]

BroadcastReceiver is an Android component that responds to system-wide broadcast announcements.

BroadcastReceiver is an Android component that responds to system-wide broadcast announcements.

Many broadcasts originate from the system – for example, a broadcast announcing that the screen has turned off, the battery is low, or a picture was captured.

Applications can also initiate broadcasts – for example, to let other applications know that some data has been downloaded to the device and is available for them to use.

Although broadcast receivers don't display a user interface, they may create a status bar notification to alert the user when a broadcast event occurs. More commonly, though, a broadcast receiver is just a "gateway" to other components and is intended to do a very minimal amount of work. For instance, it might initiate a service to perform some work based on the event.

For more information visit the Android BroadcastReceiver reference or the documentation for the receiver element used in the Android manifest file.

859 questions
8
votes
1 answer

Set Android BroadcastReceiver on React Native

I am building an application on React Native and I would like to use the Android Service NotificationListenerService. In order to capture data from the service, I need a Broadcast Receiver. How can I set the BroadcastReceiver up at the React Native…
8
votes
2 answers

Android 7 intent extras missing

Does anyone know if there are any changes to how Android 7.0 (Nougat) handles intent extras compared to Android 6.0 (Lollipop)? Long story short: my app works as intended on all versions from 4.1(16) to 6.0(23) but crashes on android 7.0(24)! The…
8
votes
3 answers

Bluetooth Device Button Press Should Trigger Onclick Listener in the app

I'm trying to make an app which triggers an on click listener in the app when a button is pressed on the paired bluetooth device. After googling for several hours I think I am unable to send keycode of the button of the bluetooth device to broadcast…
7
votes
1 answer

SMS Retriever API not working with Firebase PhoneAuth

I developed one android application that has firebase phone number authentication. After enter phone number, firbase sent Verification OTP number via SMS. So I add and allow SMS Read permission in my application Now as per Google Play Policy, We…
7
votes
2 answers

How to receive USB connection status broadcast?

I am trying to detect USB connection in my app, that is, whether or not USB is connected to device. It's being tested on Marshmallow 6.0.1 (sdk23) But I'm unable to receive the broadcast actions ACTION_USB_DEVICE_ATTACHED or…
7
votes
1 answer

BroadcastReceiver is not called after createChooser(context,intent,IntentSender) is executed

I want to detect what app the user selects after I present him with a createChooser() dialog. So I have created my BroadcastReceiver subclass like this: import android.content.BroadcastReceiver; import android.content.Context; import…
6
votes
0 answers

LifeCycleOwner in Broadcast reciever

I am using Android Room to store my application data. After device reboot I need to retrieve them and do some functions. I am using LiveData for getting data from database. But I cannot bind Broadcast Reciever as owner. How should I resolve this…
voximdo
  • 53
  • 2
  • 14
6
votes
2 answers

Broadcast Receiver not working when the App killed in Oreo Why?

How can i receive data of incoming message using broadcast receiver in Oreo, its working perfect in before Oreo version,but i am unable to receive in Oreo, i have trying to short out this by help of developer site but there is not any sample code…
Basant
  • 741
  • 7
  • 16
6
votes
1 answer

How register Broadcast Receiver for media button in Oreo?

I have a problem with the new Android version, that is 8.0 (Oreo). I have to register a broadcast and I do this with this code: // android.intent.action.MEDIA_BUTTON IntentFilter filter = new IntentFilter(Intent.ACTION_MEDIA_BUTTON); r = new…
6
votes
1 answer

Handle network changes on android 7 Nougat

Is there any way to handle wi-fi or cellular networks enable/disable on android N. I've tried to add broadcast receiver with intent-filter "android.net.conn.CONNECTIVITY_CHANGE", but it's deprecated for N and higher.
6
votes
4 answers

Receive Parse notification using custom broadcastreceiver

Am using parse notification in my app. Am receiving notification alert using GcmBroadcastReceiver. But am seeing lot of notification receiving to my app. I thought to update notification in status bar so i used custom receiver. When receiving…
Gayathiri
  • 427
  • 1
  • 4
  • 9
5
votes
0 answers

Delayed broadcast response for new SMS Retriever API

Recently we decided to start using SMS Retriever API to read OTP. I followed all steps and it's working correctly. The problem is BroadcastReceiver is getting callback after a long delay. SMS notification is pushed by system as soon as SMS is…
5
votes
1 answer

Android BroadcastReceiver Database Access with Room

I have setup an alarm that calls each hour a broadcast receiver. This receiver tries to load data from the sqlite database. The problem is, that the list of reminders is null. The same codes works in an activity, but not in the receiver. Is there…
5
votes
5 answers

Activity Transition API not working

I wish to use the new Activity transition API and after following the tutorial here I am not able to get the desired result. This is the code I have for setting the activity transition I wish to detect : public void setActivityTransitions() { …
1 2
3
57 58