Questions tagged [broadcastreceiver]
BroadcastReceiver is an Android component that responds to system-wide broadcast announcements.
8,370
questions
0
votes
0
answers
8
views
getting error while opning razorpay payment geteway
getting error java.lang.SecurityException: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts for android 14....
-1
votes
0
answers
8
views
PendingIntent data transmission issue: Data received on API33, but not on API27. Reminder: note in the BroadcastReceiver is null. Any insights?
[enter image description here](https://i.stack.imgur.com/UH3HG.png)
BroadcastReceiver
[enter image description here](https://i.stack.imgur.com/ACUxw.png)
alarmManager
[enter image description here](...
1
vote
1
answer
56
views
What is the proper way to use registerReceiver in Android 14/SDK 34?
I'm getting the following warning on the code below
hardwareScanBroadcastReceiver is missing RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED flag for unprotected broadcasts registered for an IntentFilter ...
2
votes
2
answers
59
views
Extras on intent null in onReceive method in BroadcastReceiver
I have a problem where I'm trying to set up an Android notification, but when I schedule an intent with extras, the extras come over as null.
My code to create the Intent and the PendingIntent looks ...
0
votes
0
answers
51
views
androidx.core.content.ContextCompat.RECEIVER_NOT_EXPORTED flag error in ContextCompat.registerReceiver [Broadcast receiver]
val intentFilter = IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
ContextCompat.registerReceiver(
...
0
votes
1
answer
24
views
My intent is null but I should get an intent from my Broadcastreceiver
I am new to android development and I struggle on this problem for a while, it would be really nice if you can help me. :)
I try to build an App where I can transfer data between my mobile phone (it ...
1
vote
1
answer
19
views
ShareSheet Broadcast Receiver doesn't fire
Trying to implement an Android share sheet, and following the official docs. The sheet comes up and the sharing works as expected. However, the broadcast receiver never fires. Here is the code:
In the ...
0
votes
1
answer
67
views
SensorManager unregisterListener doesn't work
What I want to do is to read data from the proximity sensor when I answer a phone call. I can read data from the sensor when the state is OFFHOOK. However, when I end the phone call (state IDLE), the ...
0
votes
0
answers
55
views
How to send a WhatsApp message in a BroadcastReceiver when a call ends, even when the app is in a killed state?
I'm working on an Android application where I need to send a WhatsApp message automatically when a phone call ends. I have a BroadcastReceiver set up to detect the end of a call, and it works ...
2
votes
0
answers
17
views
Android - Alarm Manager and DST changes
I use an alarm manager to create repeating alarms (at a specific time) and exact alarms (at a time that changes from day to day).
The problem occurs when there's a DST start or finish:
For my ...
2
votes
1
answer
30
views
Send data from Broadcast Receiver to simple java class while app is closed
I'm building an android app to handle SMS, I made Broadcast Receiver to listen for incoming SMS. when it comes it should send SMS content to another class to do so some logic, I used interface to ...
0
votes
1
answer
42
views
Floating action button in Android on all the screens
I am a newbie is android , As a part of my project, I need to create a floating action button which is seen all screen all overs the device ,and on click of that button should disable the screen ...
-1
votes
1
answer
31
views
Android application which shows toast message when user turns on and off the Flashlight from the System
I want to create an Android application using Java that displays the toast message when the user turns on or off the flashlight from the system and not from the app.
I discovered that there is no ...
0
votes
0
answers
52
views
Passing Data From Broadcast receiver to composable screen
I have setup geofence through my viewmodel of compose screen and have broadcast receiver to receive different geofence event. I am successfully receiving data in onReceive() now I want to update my ...
0
votes
0
answers
39
views
Cannot copy OTP code to clipboard in broadcast receiver on Redmi Note 9S (Android 12)
Problem:
I am trying to copy the OTP code from an incoming SMS to the clipboard in a broadcast receiver. This is working fine on Galaxy A52s 5G but not on Redmi Note 9S.
Codes:
OTP Broadcast Receiver:
...
0
votes
2
answers
41
views
Why dynamic registered standard Broadcast in Android cannot be received?
My code in a fragment:
`private var logoutReceiver: BroadcastReceiver? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
logoutReceiver = object : ...
0
votes
0
answers
80
views
BroadcastReceiver not receiving Intent in the same Composable in Android
I’m having a little experiment on android API 26 using Jetpack Compose and I’m having trouble with sending and receiving broadcasts within the same composable.
Here's the code for my receiver:
class ...
0
votes
1
answer
96
views
Data binding not working for FragmentA after returning from FragmentB
My app has two fragments: HomeFragment and StatusFragment. HomeFragment binds some connection info to the UI. Info is obtained from broadcast receiver. At the beginning, data binding works in ...
1
vote
0
answers
7
views
I have to bring text from any other app into my app through SHARE-TO method
I want to perform tasks in the background in my app without open ui.
You have to bring text from any other app into your app through shareTo method.
here is my code in AndroidManifest.xml
.
.
<uses-...
0
votes
0
answers
49
views
broadcast receiver of boot completed in android 11
i faced problem about broadcast receiver of boot completed in android 11 it was working under android 11 but on this version doesn't work, what can i enable in settings or update my source code
public ...
0
votes
0
answers
17
views
Execute a periodic worker when the device is switched on
I am developing a news reader based on a RSS feed. So far I created:
a worker to retrieve the feed and convert it to a list of objects, so
I can show it on a listview;
a periodic worker which is ...
1
vote
0
answers
69
views
Integrating SMS Broadcast Listener with React Native App for Background Processing
I'm working on a React Native application where I need to integrate an SMS listener that can run even when the app is closed. I've already made an attempt with native code and related React Native ...
0
votes
0
answers
106
views
Differentiating SMS Messages from Dual SIM Phones with Limited Information
I'm working on a mobile app that deals with receiving SMS messages both retrieving from the SMS content URI "content://sms/inbox" or from a broadcast received, and I'm facing a challenging ...
0
votes
0
answers
51
views
Sms autofill not working when install from google play - Android
When the user installs my app from Google Play, SMS reading is not applied and the SMSBroadcastReceiver class does not called
But it works when the APK is installed
What is the problem ?
0
votes
0
answers
30
views
Android: Secure & Efficient Communication Between SDK & Application - Best Practices
Question:
I am developing a payment SDK in Android, which will be integrated into various consumer apps, including third-party applications for example Amazon. The SDK's primary function is to ...
0
votes
0
answers
26
views
BroadcastReceiver not receiving BOOT_COMPLETED in AOS
My Source Code
WeatherLockReceiver.kt
@AndroidEntryPoint
class WeatherLockReceiver : BroadcastReceiver() {
@Inject
lateinit var preferenceRepository: PreferenceRepository
override fun ...
1
vote
0
answers
60
views
SMS_RECEIVED Broadcast receiver stops working after some time
I'm working on a utility application in which when an SMS is received with a specific message I need to send a reply message. To know the sms_received event i used a broadcast receiver. Below it the ...
0
votes
1
answer
19
views
Broadcast Receiver class not triggered when app is launched
Please I need help. I have 4 BroadcastReceivers: SimCardStateReceiver, AutoTimeReceiver, AutoTimeZoneReceiver, and TimeZoneReceiver.
At the moment, only the SimCardStateReceiver is triggered. All the ...
0
votes
0
answers
32
views
Auto start android java application when USB is connected to mobile?
I'm trying to start an android application whenever any hardware is connected to mobile's USB port.
What I'm doing is creating a BroadcastReceiver and and registering it in the AndroidManifest.xml
<...
0
votes
1
answer
55
views
BroadcastReceiver onReceive() is not working on Fragment using Kotlin MVVM structure
I'm working on a app that capable of checking all bluetooth device and need to display it on recyclerview on load of the app. Im using BroadcastReceiver for the searching of the devices. but ...
7
votes
1
answer
1k
views
Android 14 context registered broadcast receivers not working
I'm experimenting with my app on an Android 14 device, where I'm sending a local broadcast and then subscribing to it within the app. However, when I utilize the RECEIVER_NOT_EXPORTED option, the ...
0
votes
0
answers
23
views
How to detect empty sim tray insertion in android
How to detect empty sim tray insertion in android
Not able to detect empty sim tray insertion using sin state change broadcast receiver.
How to detect empty sim tray insertion in android
Not able to ...
0
votes
0
answers
35
views
Issue with Google SMS Retriever API (SMS_RETRIEVED_ACTION status code always TIMEOUT)
I try to receive code from the message and put it into EditText. I created SmsBroadcastReceiver
The I register my BroadcastReceiver:
val client = SmsRetriever.getClient(context)
val task = ...
0
votes
0
answers
18
views
Notify compose of successfully pinning a widget to home screen from the app
I am currently trying to change the compose layout after the user is prompted and has added to home screen a widget from the launcher prompt using requestPinAppWidget (doc here). I know the success ...
0
votes
0
answers
42
views
Google TV remote volume up/down not registering
Hey all I have been trying to get my remotes volume up/down buttons to register in my app but they never seem to do anything when I press them?
I have tried:
public class CallBroadcastReceiver extends ...
1
vote
0
answers
288
views
Handle media button actions manually in media3
How can I manually handle media button actions with Media3 in a peaceful and compatible way without using MediaSessionConnector?
Previously, I used to handle media button commands using ...
0
votes
0
answers
30
views
Launch on Boot on android 9 api 28 by java
In the emulator everything is working fine. When i install the build signed apk on the android tv, that's not working. In MainActivity file i am using webview
here is the code of android manifest.xml ...
0
votes
1
answer
20
views
My android app doesn't run in the backround
So I'm really new to android development and I'm trying to create an app that receives an SMS message and performs some calculations on the message and then saves them in a Shared Preferences file.
...
0
votes
1
answer
27
views
Auto open app from another app using android kotlin
I want to open one/multiple app from another app automatically in a specific time.
I tried below code to open a specific app. But it is not working.
MainActivity.kt
class MainActivity : ...
0
votes
0
answers
22
views
Android how to set Daily Alarm at a specific time?
I want to assume every day exactly at 10am will play music, i used Brocast to do that but time is not correct and played music 10 hours earlier
<receiver android:name=".component.main.profile....
0
votes
0
answers
59
views
Is it possible to detect and intercept an outgoing SMS message using a BroadcastReceiver in Android 13?
I am a college student working on their capstone project and was wondering whether it was possible in recent versions of Android, specifically Android 13, to intercept and potentially block an SMS ...
0
votes
1
answer
47
views
Why is my notification click event not working when my app is in the background or cleared from recent applications?
The click redirection to NotificationMainActivity doesn't function properly when the application is in the background or cleared from the recent applications. While the app is in the foreground, ...
0
votes
1
answer
11
views
Pass ArrayList<LatLng> from ForegroundService to MainActivity
I am fetching Latitude and Longitude coordinates and trying to send it via a broadcast to my MainActivity, however, my Bundle in the BroadcastReceiver is always null.
Here is my code so far:
...
0
votes
0
answers
82
views
Activity doesn't start when the app is in background
I am developing an Android app that has LockScreen.
To make this, I created a Service and two Activities.
ScreenLockService
MainActivity
LockScreenActivity
MainActivity is the main entrance activity....
0
votes
0
answers
205
views
Queued broadcast delivery on Android 14 - time of delivery
On Android 14, broadcasts to context-registered receivers are queued while an app is in the background and in a cached state. The broadcasts won't be delivered until the app is brought back to the ...
0
votes
0
answers
44
views
Android: Run Activity from BroadcastReceiver
I'm pretty sure that was asked many times and I researched it a lot. But still stuck with my problem.
I have MainActivity which is launched at Application Start, where I have added a Button on click ...
0
votes
0
answers
19
views
Broadcast receiver in Android Studio
How to solve this on Android Studio in Java Language?
You have to make two applications that:
The First app is broadcast receiver
The second app is twit broadcast app
And you should show us:
broadcast ...
0
votes
1
answer
67
views
Composable with Flow from Room Db not updating from BroadcastReceiver
I have an app where the users screen is made up of a list of objects from the DB. Those objects are updated in the background using a BroadcastReceiver that run business logic code periodically as ...
4
votes
2
answers
1k
views
registerReceiver error hint " Must be one or more of type"
using
ContextCompat.registerReceiver(this, mIntentReceiver, filter, ContextCompat.RECEIVER_EXPORTED);
or
registerReceiver(mIntentReceiver, filter, Context.RECEIVER_EXPORTED);
it hints "Must be ...
0
votes
0
answers
15
views
Broadcast receiver event for application update
I have a broadcast receiver that's registered for MY_PACKAGE_REPLACED event.
<receiver
android:exported="true"
android:name=".MyReceiver">
<intent-...