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

Check for internet on all activity and show message WHILE net is disconnected

AIM Here is what I want to do: Check for internet connection at all the times in all the activities of my application (I have like 13 activities so far). If net is working then all is fine. If net is not working, show a message (using…
3
votes
0 answers

TextToSpeech in a service during a call

I am creating an app which tells the user about the person who is calling. So as a part of testing, I created an abstract class whih extends broadcast receiver in order to handle the calls. I've also created a class which extends the abstract class…
3
votes
2 answers

How to check app is running in background of foreground in BroadcastReceiver

i want to check whether the my application is in a background or in a Foreground and i also want to check the app in open or not using BroadcastReceiver public class CheckRunningApplicationReceiver extends BroadcastReceiver { Context…
Gaurav Mandlik
  • 525
  • 1
  • 9
  • 42
3
votes
1 answer

Capturing event if power button is pressed for 3 seconds or clicked 3 times inside Service

I want to capture Power button press event in my app and that too inside a Service that runs in background. For this I used following code with Broadcast Receiver. private static final String ACTION="android.intent.action.SCREEN_ON"; private…
Vivek Mishra
  • 5,669
  • 9
  • 46
  • 84
3
votes
0 answers

Automate video call android

I'm trying to automate a video call over android, I succeed by making a regular call from device1 to device2 by am start -a android.intent.action.CALL -d tel:device2.number after device2 answers I'm starting a video call by UI, The problem with…
3
votes
0 answers

Mismatch between BuildConfig.VERSION_CODE and PackageManager.getPackageInfo() after application update

I discovered a strange situation appears to happened a lot to the my application users (via Crashlytics/Google Analytics reporting..) which I did not able to reproduce: after my package been updated - the version code returned by the PackageManager…
3
votes
4 answers

Android Fragment - BroadcastReceiver call fragment method

I have a BroadcastReceiver which receives broadcast sent to a Fragment. I'm getting the broadcast but how can I call a method from the Fragment itself? I basically need to update a List once the broadcast arrives, the List & update method are part…
3
votes
0 answers

SeekBar - leaks IntentReceiver

When I use a SeekBar I always get following warning: Activity com.prom.gallery.activities.VideoActivity has leaked IntentReceiver android.widget.AbsSeekBar$2@1803f19a that was originally registered here. Are you missing a call to…
3
votes
4 answers

How to find out where is from broadcastReceiver calling?

I'm working on a combination of few big projects which I'm not much familiar. I have a Local broadcast events and it register from the script. context.registerReceiver(stReceiver, stIntents); private BroadcastReceiver stReceiver = new…
Zusee Weekin
  • 1,348
  • 2
  • 18
  • 41
3
votes
0 answers

What android broadcasts are sent by gmaps while navigating?

I am developing an android application which captures the location of every turn the user made while navigating from a source to a destination. My application would launch gmaps automatically and will run in the background, until the user has…
3
votes
3 answers

Android - Avoid the alarm triggering when user changes date/time

I have an app that sends periodic alarms every day of the week, through the method setRepeating from AlarmManager: Intent intent = new Intent(context, AlarmReceiver.class); intent.putExtra(INTENT_TAG_ALERT_ID, lastAlertId.getId()+""); …
3
votes
1 answer

Internet access blocked when application is in background

I am trying to post some data from broadcast receiver but when my app is in background for long time, its not able to connect to internet and below error I am getting in log: java.net.ConnectException: failed to connect to…
Ritika
  • 101
  • 1
  • 4
3
votes
0 answers

ReceiverCallNotAllowedException in BroadcastReceiver using application context

I am getting the following error on Android versions 4.1.2: Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.example.PluggedInBroadcastReceiver: android.content.ReceiverCallNotAllowedException: IntentReceiver components…
3
votes
2 answers

Programmatically Register For BOOT_COMPLETED Broadcast

I am trying to register my service to startup when the phone boots. I have setup a BOOT_COMPLETED BroadcastReciever in my service class: public int onStartCommand(Intent intent, int flags, int startId) { startService(intent); …
3
votes
2 answers

prevent other apps from sending broadcasts to my broadcastReceiver

I have a broadcastReceiver registered in manifest that receives broadcasts sent from one of my services with a custom action. I have it already working but for security reasons i want to prevent other apps from sending fake broadcast to my receiver.…