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
0
votes
2 answers

BroadcastReceiver's onReceive not called when battery level changes

I have BroadcastReceiver with BATTERY_CHANGED IntentFilter. When I try send broadcast, onReceive doesn't call. What's wrong? Here is my receiver description in manifest
0
votes
0 answers

Block incoming sms android using BroadcastReceiver

I'm developing an android application about Block incoming Sms. My problem is when I built my app and tested. I could not block any sms. Here my code : My Manifest :
0
votes
1 answer

class for reciving sms not work

I used this code for block sms revised. but when I installed it on my phone and receive a sms log not printed in logcat. i think this class is not run when a sms is received. here I add BroadcastReceiver class and manifest. public class SmsFilter…
coder65
  • 61
  • 7
0
votes
1 answer

the soot-based flowdroid with an exception error when test an APK

I am trying to test the broadcast receiver component in an android application based on the taint analysis. However, when i am using the frowdroid to test the related application, it shows: Exception in thread "main" java.lang.NoSuchMethodError:…
Field.D
  • 158
  • 1
  • 1
  • 9
0
votes
0 answers

Is it a good practice to use LocalbroadcastManager and ResultReceiver to update progress bar?

After a long searching for the solution to retain the progress bar view while switching the fragment. You can find the whole description here I just wanted to know if i will use LocalBroadcastManager and ResultReceiver to receive the progress update…
0
votes
4 answers

ProgressDialog is not closing with BroadcastReceiver

I am using BroadcatReceiver to monitor wi-fi state changes. And I want to show ProgressDialog during the operation. It is showing properly but not closing. My code is like below:: private final BroadcastReceiver mBluetoothChangeReceiver = new…
0
votes
2 answers

Can't get State from NetWorkInfo Android

As the title says, I can't get State in Broadcastreceiver from NetWorkInfo Class. It returns some errors in log output which are given below. I need your help. Here is the log output and the Broacastreceiver class , I also notice that I've added…
0
votes
1 answer

GCM isn't receiving the message after some second when the power button pressed (SLEEP)

Please help me to solve this problem guys.. The phone only receive message when the device is on. When it's off for some second around(20-30) by pressing the power button then it's stop receiving and will continue to recieve when it's on. This is…
0
votes
1 answer

Deleting a file from BroadcastReceiver

I have a class that calls a BroadcastReceiver. I am struggling to delete a file when it's called. If I use deleteFile("file.txt") within the class it works and deletes the file. However if I try deleteFile("file.txt") within the BroadcastReceiver…
0
votes
1 answer

Passing data from android activity to broadcast receiver on device boot up

I always get bundle value null when I pass data from activity to broadcast receiver. My receiver will start on boot up. This is the code in my activity class Intent intent= new…
user1810931
  • 638
  • 2
  • 11
  • 33
-1
votes
1 answer

ANDROID - How to access another class from a different Class?

I have a MapView.java wherein it requests for SMS permission, Location permission etc. I created a new Java class for the SMSReceiver, which extends BroadcastReceiver and has an onReceive method. The problem is, I am struggling with how I will call…
lolo mo
  • 61
  • 1
  • 9
-1
votes
1 answer

Android Broadcast Receiver is showing permission error even it is set

I am having trouble setting up Broadcastreceiver on SMS Receive. I have set all permissions but still it is giving the following permission error .../system_process W/BroadcastQueue: Permission Denial: receiving Intent {…
Code Lover
  • 8,099
  • 20
  • 84
  • 154
-1
votes
1 answer

How does BroadcastReceiver work belong to app state?

My question is about behavior of Receivers when app is 'Died' - does receivers die also with it, or they are still working in memory? My problem is about such situation - I can't listen action 'App is destroyed' and carefully do…
alena_fox_spb
  • 697
  • 1
  • 8
  • 24
-1
votes
1 answer

Android service destroyed itself

I have a BOOT_COMPLETED Receiver. This receiver starting the service when the phone booted.But when receiver worked and started the service , working just onDestroy module on Service. I don't know why. I create a JobScheduler and checking service…
Somomo1q
  • 655
  • 2
  • 10
  • 19
-1
votes
3 answers

Update the text of a button contained in a custom notification when clicked in Android

UPDATE I modified my code by updating the notification as advised by Pawel and Amit K. which I thank both. In the 'alarmNotification' method I create the notification with id1 and, when the button clicks, I pass the variable (string) "on" to the…