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
3
votes
1 answer

Referral Code not retrieve after installing from play store

I needed to integrate referral code implementation in my app for that I created url with : https://play.google.com/store/apps/detailsid=MY_PACKAGE_NAME&referrer=USER_REFERRAL_CODE and created broadcast receiver for…
Tecksky Android
  • 133
  • 3
  • 14
3
votes
0 answers

Android standard app chooser created by Intent.createChooser(Intent target, CharSequence title, IntentSender sender) lags

An app starts Android standard app chooser created by Intent.createChooser(Intent target, CharSequence title, IntentSender sender). On Nexus 6 and Nexus 6p with Nougat it often lags: all items are without icons, just labels, icons are displayed…
AndrewS
  • 2,679
  • 2
  • 14
  • 23
3
votes
1 answer

Android USB actions(ACTION_USB_DEVICE_ATTACHED & ACTION_USB_DEVICE_DETACHED) not working in BroadcastReceiver

I'm working on a App which has a requirement to listen on USB events (ACTION_USB_DEVICE_ATTACHED & ACTION_USB_DEVICE_DETACHED). I have created a receiver which listens on the these actions. But my receiver is not firing up when any of these events…
3
votes
2 answers

Android broadcast receiver not registered error

I have used Intent to open Location Settings menu to enable gps in my Activity.After calling Intent I have used a Service to listen to the location updates.I sent two BroadcastReceivers from Service to Activity.In the onResume() method of the…
jobin
  • 1,489
  • 5
  • 27
  • 52
3
votes
1 answer

AlarmManager and WakefullBroadcastReceiver how private are the passed Extras?

I am trying to implement some alarm scheduling by using AlarmManager. Since when a alarm is triggered, I want to use a WakefulBroadcastReceiver which starts an IntentService to do some background job. I have some questions related to…
Alin
  • 14,809
  • 40
  • 129
  • 218
3
votes
2 answers

Alarm Manager not firing on screen is off

I set alarm manager for time control.My purpose continue to time controlling on screen off. While screen is on everything is ok but when i locked to device(screen of) my broadcast receiver not receiver anything i tried lots of different solution…
3
votes
1 answer

Boot completed broadcast receiver context parameter

I am working on a service that can start at device boot completion, i am setting a preference file to store service running state so i can retrieve it when i need it, in my broadcast receiver : public class MyServiceBootReceiver extends…
3
votes
4 answers

Is it possible to call onReceive method from a dialog?

I have a custom dialog with editText and save button. When button clicked, I want it call MyReceiver. But the log and Toast in MyReceiver never get displayed. Reminder final AlertDialog.Builder builder = new AlertDialog.Builder(this); …
3
votes
2 answers

Android AsyncTask from Service (started from receiver) unable to resolve host

I have an AsyncTask, connecting to my server. When I run it from Activity - everything works good. But when it is started from BroadcastReceiver inside onReceive() and application is in background - it always throws Exception: Unable to resolve host…
Goltsev Eugene
  • 3,325
  • 6
  • 25
  • 48
3
votes
1 answer

How to pass custom Serializable object to BroadcastReceiver via PendingIntent

I am trying to pass a custom Serialized object from my IntentService to a BroadcastReceiver using PendingIntent. Here is my custom object: Row.java public class Row implements Serializable { private String name; private String address; …
3
votes
1 answer

AnalyticsReceiver - what is that for? And why it causes 'Receiver does not require permission' warning?

In my Android application in manifest file i have following receiver and service declaration:
3
votes
2 answers

BroadcastReceiver not firing on notification action click

I am trying to create a simple notification with a button (action) defined to it. I have managed to display it properly and create a PendingIntent for my action. I have also created a BroadcastReceiver which is supposed to be called when my action…
3
votes
1 answer

How to get the `BroadcastReceiver` instance which is defined in `AndroidManifest.xml`

I have a BroadcastReceiver in my app, and it was defined in AndroidManifest.xml as below: This is…
L. Swifter
  • 3,179
  • 28
  • 52
3
votes
2 answers

Android - get a reference to a BroadcastReceiver defined in Manifest

Is there any way how to get a reference for a BroadcastReceiver defined in Manifest.xml from code? In my case, we are using a BroadcastReceiver that needs to be included in the Manifest.xml. However it has functionality I would like to reuse from…
3
votes
2 answers

BroadcastReceiver.getResultsExtra() vs. Intent.getExtras()

When looking at Android source, I observe two common methods for getting the Bundle containing the result's extra data. A. Calls getResultsExtra() private class StatusBroadcastReceiver extends BroadcastReceiver { @Override public void…
GrandAdmiral
  • 1,348
  • 2
  • 24
  • 52