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

NullPointerException while trying to create a new intent in WakefulBroadcastReceiver after reboot

I have written a subclass of WakefulBroadcastReceiver that receives the "android.intent.action.BOOT_COMPLETED" action when user device is rebooted.It is working fine in my Nexus device but not on some other devices like Samsung, Verizon etc. For…
shanti
  • 359
  • 5
  • 20
-1
votes
1 answer

Alarm is getting killed with app

This is becoming unreal how much an alarm will not work. I am having 2 issues with Android killing my app and as such everything stops even though everything i read says it should work. My AlarmManager item dies when i Greenify my app, Greenify to…
-1
votes
2 answers

Android - How to listen to broadcast receiver unregistered?

I have an activity A.java which sends a broadcast and needs to wait for this broadcast unregistered then do something else. This broadcast receiver will invoke another activity B.java and only unregister the broadcast receiver when the activity is…
-1
votes
1 answer

Service if BroadcastReceiver running then do nothing in Android

I'm new at Android, so please excuse my low experience. I need this service to check if BroadcastReceiver is running or not every period of time. If it's running then I want it to do nothing, but if not running I want it to run it. In this code…
-1
votes
1 answer

BraodCastReceiver not firing for phone state listener android

I am try to register and unregister the phone state broadcast receiver in a service but its not firing at all i have declared the phone state permission in manifest as well. Here is my broadcast receiver. public class IncomingCalls extends…
-1
votes
1 answer

Keep alarmmanager alive even if the app is killed

I have the code belowe what i start from MainActivity and it is working fine if the app isnt killed or closed. But if the app is killed/closed and the phone is going to sleep it doesnt work. App Killed/closed + phone sleep = the alarm stops App…
-1
votes
1 answer

Issues creating a Notification from within onReceive

Here's my issue.. I have an AlarmManager with a Timer, which fires a Receiver when the timer expires.. When the Timer expires, and the onReceive is fired within the Receiver, I want to create a NOTIFICATION in the Notification Bar.. However, for…
-1
votes
1 answer

Displaying all SMS from one specific sender in my android app

My app is currently displaying all the SMS in the inbox with this code: public void onClick(View v) { if (v == btnInbox) { // Create Inbox box URI Uri inboxURI = Uri.parse("content://sms/inbox"); // List required…
Josh
  • 187
  • 3
  • 13
-1
votes
1 answer

How to start a broadcast receiver on a separate global process from that of the application?

I have an android application where I am implementing push notifications using GCM. I have a broadcast receiver and an intent service for handling GCM Push notifications. My requirement is that I want to receive the notification inside OnReceive of…
-1
votes
1 answer

At what point or phase of Application INSTALL.REFERRER broadcast Receiver is called?

I have registered a BroadcastReceiver in my Android Manifest. It contains an action of INSTALL.REFERRER to receive intents whenever the application get Installed. I am trying to set a variable by fetching its value from server before the …
-1
votes
1 answer

Starting an Android service from system's SMS broadcast receiver

Can anyone please tell me if it is possible to "wake up" my Android service as soon as there's an incoming SMS event? What I meant to say is that, whenever an SMS is received, there will be a system-wide broadcast of this event. Can I intercept this…
-1
votes
3 answers

Saving value in Shared Preference giving error

I want to store a string value that is inside an if block and i want to access the value outside of it. Now i tried with this code but it is giving me error and app force closed by saying "Print ln needs a message". It is a broadcast receiver class…
-1
votes
1 answer

android call function through broadcastreceiver

i have a broadcastreceiver.class public class Myclass extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { } } i want to call function in broadcastreceiver which is in my activity.please tell…
-1
votes
1 answer

How to send Intent to SMS Receiver?

I would like a send an intent to this receiver from another application, which handles SMS. I am quite new to this SMS handling. Can someone kindly guide me on what intent,I mean, how and what and intent should have to execute this piece of receiver…
-1
votes
1 answer

How can I detect action which Settings/Apps Manager is opened or not in android programmatically?

I am developing security app in android. I want that user can't uninstall and force stop my app so that can't access Application Detail Screen. But so I have used several solutions from StackOverFlow. But I haven't found right solution yet. The…