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
57
votes
7 answers

Broadcast Receiver Not Working After Device Reboot in Android

I have already checked all the related questions and have not found any solution for this problem. So this is an absolutely new problem for me. What I Have I have an Android app which registers a few broadcast receivers in its manifest. This is what…
52
votes
14 answers

CONNECTIVITY_ACTION intent received twice when Wifi connected

In my app I have a BroadcastReceiver that is launched as a component through a tag, filtering android.net.conn.CONNECTIVITY_CHANGE intents. My goal is simply to know when a Wifi connection was established, so what I am doing in…
Torsten Römer
  • 3,834
  • 4
  • 40
  • 53
36
votes
3 answers

Fatal Exception: android.app.RemoteServiceException: can't deliver broadcast at android.os.Handler.dispatchMessage

I am using broadcast messages on my android application (From io.socket I am sending broadcast messages to my Activity page). On some devices Samsung SM-G950F and SM-A520F I got an error "Fatal Exception: android.app.RemoteServiceException: can't…
35
votes
6 answers

Android O : PHONE_STATE broadcast limitation

I have been trying to do something similar to truecaller app, where my app is supposed to show a screen after a call gets hung up. Was achieving this by registering android.intent.action.PHONE_STATE implicit broadcast in the manifest file. But it…
29
votes
2 answers

WakefulBroadcastReceiver is deprecated

For creating a receiver I'm extended WakefulBroadcastReceiver in my old project. But now it's deprecated. Instead of WakefulBroadcastReceiver which Receiver I should use now and how to convert below code with new method? Here is my code: public…
Yeahia2508
  • 7,526
  • 14
  • 42
  • 71
29
votes
2 answers

Runtime exception Android O with boot_completed

I'm trying to start an IntentService within my BOOT_COMPLETED receiver, but in Android O (API 26) I get: java.lang.RuntimeException: java.lang.IllegalStateException: Not allowed to start service Intent { act=intent.action.update…
24
votes
7 answers

How to keep alive my BroadcastReceiver

Currently I'm developing a call blocker application like Truecaller. What I needed I want to detect the incoming calls even my app is removed from the recent apps list. Manifest.xml code
17
votes
8 answers

Why SMS Retriever API don't work in release mode?

I've implemented the SMS Retriever API like in the google tutorials and in my debug Build Variant work fine. I can read the sms and get the code to the user can do the login. My problem is when I run the app in release Build Variant the sms it…
17
votes
4 answers

android GoogleAuthUtil.getTokenWithNotification Intent callback not triggering

I have a background service that calls GoogleAuthUtl.getTokenWithNotification and it works properly but I'm trying to implement the callback portion of this function and that isn't working properly. I've implemented a broadcast receiver and added it…
16
votes
3 answers

Awareness API & Android O using BroadcastReceiver

I have an Android app which uses the Awareness API to setup a fence when a headset is plugged in. I have implemented the AwarenessFence using code much like in the examples at: https://developers.google.com/awareness/android-api/fence-register. I…
15
votes
6 answers

Oreo BroadcastReceiver SMS Received not working

An app I'm working on allows the user to allow the app to read the contents of a confirmation SMS to input the verification code on its own. For all devices using an OS earlier than Oreo (API 26), the implementation of the BroadcastReceiver works…
15
votes
3 answers

Properly tracking install referrals on Play Store

I have a simple task: I want to track the referral id of an app install and pass it to backend. What I did: I created a link with an extra parameter referrer and appended it to the invite link. When it is opened, the javascript detects if the…
15
votes
7 answers

Register broadcast receiver dynamically does not work - BluetoothDevice.ACTION_FOUND

Using Log class to track Runtime show that onReceive() methode does not called,why ? Register broadcast receiver dynamically private void discoverDevices () { Log.e("MOHAB","BEFORE ON RECEIVE"); mReceiver = new BroadcastReceiver() { …
Error
  • 820
  • 1
  • 11
  • 34
14
votes
3 answers

Accepting a Call via Bluetooth Headset

i am working on a VoIP-Android-App. I would like to accept and decline Calls via a connnected Bluetooth Headset in an Activity. What I have tried so far: Using a Media Session to receive Media Button clicks. Problem: If we start BluetoothSCO we…
1
2 3
57 58