broadcastreceiver

Issues with Hilt on invoking a BroadcastReceiver

不羁的心 提交于 2021-02-05 10:43:18
问题 I'm facing a similar issue like this. I assume that Hilt is not able to invoke my BroadcastReceiver and I really don't have a clue how to make it work. I tried with the solution provided. The code runs smoothly, but still the BroadcastReceiver won't get invoked. This is what I did so far: AndroidManifest.xml <receiver android:name=".receiver.BatteryLevelReceiver"> <intent-filter> <action android:name="android.intent.action.BATTERY_LOW" /> <action android:name="android.intent.action.BATTERY

is there a way that I can clear the broadcast of SMS_SENT or SMS_DELIVERED so that other apps won't get it?

半世苍凉 提交于 2021-01-29 15:09:38
问题 I am looking for a potential hack in my application where I am unable to get the onReceive() or SMS_SENT or SMS_DELIVERED in devices like Oppo, Vivo, Mi. A message is sent from my device and I register a receiver to listen for the status of the message, sent and delivered, after that, I will do some networking calls. Currently, My App is unable to get the onRecieve(). Why? Because I add value to an Array every time my onReceive() gets called and send to the server. I am getting an Empty Array

Local notification not triggering in Android 10

拈花ヽ惹草 提交于 2021-01-29 08:31:33
问题 I am working on xamarin.forms app and I am setting local notification using alarm manager. It is triggering fine on android version 8 and 9 but somehow it's not triggering in Android 10 . In android device logs for Android 10 , I got 07-22 15:00:06.612 Samsung SM-M205F Verbose 4185 SamsungAlarmManager Sending to uid : 10244 action=null alarm=Alarm{a757a70 type 0 when 1595410200000 com.MyApp.andr.connect} 07-22 15:00:06.613 Samsung SM-M205F Warning 4185 BroadcastQueue Unable to launch app com

Android AppWidget Battery-Status

北城以北 提交于 2021-01-29 08:11:23
问题 I'm looking for make an AppWidget that check the battery status (level, charging/not charging). I wrote a lot of codelines, but, even if it work perfectly, I see that put it on the screen make the telephone slower and, sometimes crash. I think it's because I make something wrong. Can someone help me? Thank's Here My Manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="it.bisneff.widgetone" android:versionCode="1"

Flutter Plugin: How to set a programatic Receiver with IntentFilter

我只是一个虾纸丫 提交于 2021-01-29 07:24:47
问题 Problem I have been working on a Flutter Plugin for the Radar SDK, however, I am unable to programmatically set my BroadcastReceiver. This works, but I cannot access my EventChannel When I set my Receiver in the android Manifest of the plugin, the receiver is called properly. The manifest can be seen below: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yourorg.appname"> <application android:name="io.flutter.app.FlutterApplication"> <receiver android:name="

Broadcast receiver onReceive() is not called

旧城冷巷雨未停 提交于 2021-01-29 04:16:49
问题 Broadcast receiver mBroadcastReceiver = object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { Log.i(TAG,"contact list populate broadcast") var action = intent.action Log.v("Action is ",action) when (action) { GetContactListFromServer -> { println("Get contact list") } } } } val filter = IntentFilter(GetContactListFromServer) this.registerReceiver(mBroadcastReceiver, filter) This is how I am sending broadcast val i = Intent(ContactListActivity.Obz

How to update RecyclerView from BroadcastReceiver?

ⅰ亾dé卋堺 提交于 2021-01-28 08:31:04
问题 In AndroidManifest.xml I have a BroadcastReceiver : <receiver android:name=".SmsMonitor"> <intent-filter android:priority="-100"> <action android:name="android.provider.Telephony.SMS_RECEIVED" /> </intent-filter> </receiver> In my MainActivity , I have RecyclerView with a list of received SMS. My question is - How I can update the RecyclerView from my BroadcastReceiver "SmsMonitor" in case new SMS received when the application is running? UPD: I mean I need solution for both states - for

My BroadcastReceiver is called two times when turning on/off wifi or gps?

大憨熊 提交于 2021-01-28 05:11:54
问题 I have googled many time to find the solution but It didn't work. struggeld with this for many days ,please help me if you faced this problem and solved it. when I turn on or off wifi or Gps the Receiver triggers two time although sometimes once but if it triggers two time it would corrupt my plans for the app. thx in advance ... inside manifest.xml : <receiver android:name=".MyBroadcastReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> <category android

How to start a activity from a broadcast receiver when the screen is locked in Android Q

淺唱寂寞╮ 提交于 2021-01-28 02:20:42
问题 I am trying to implement an alarm based application in Android Q using a broadcast receiver. I am running a foreground service using notification for triggering the alarm broadcast receiver. The service is working fine and it is also triggering the broadcast receiver. If we close the application or lock the screen after setting an alarm, the service will be running in the foreground with a notification. When the alarm broadcast is called I am trying to open a new activity when the screen is

Broadcast receiver for nought and Oreo + devices not working

青春壹個敷衍的年華 提交于 2021-01-27 18:22:34
问题 public class ScreenReceiver extends BroadcastReceiver { private boolean screenOff; @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) { screenOff = true; } else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) { screenOff = false; } } <receiver android:name=".ScreenReceiver" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.intent.action.PHONE_STATE" /> <action android