broadcastreceiver

Background execution not allowed. Android O pendingintent

牧云@^-^@ 提交于 2019-11-30 03:24:46
问题 I have a service that schedules a pendingintent which starts my notification. However, since Android O I am getting this error. I did some research, and stumbled upon context.registerReceiver , but that does not seem to fix the problem. Error: W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:my.great.package flg=0x4000010 (has extras) } to com.google.android.googlequicksearchbox/com.google.android.apps.gsa

GCM with custom broadcastreceiver

笑着哭i 提交于 2019-11-30 02:30:57
I am implementing gcm notifications in my application. Because I use my code to generate lot of application with different package names I cannot use standard mypackage.GCMIntentService name. When generating applications I do changes only in Manifest and change imports of my R class. So I impelented my own BroadcastReceiver public class GCMReceiver extends GCMBroadcastReceiver { @Override protected String getGCMIntentServiceClassName(Context context) { return GCMIntentService.class.getName(); } } to return name of GCMIntentService regardless of package name. Here is my manifest: <uses

AlarmManager, BroadcastReceiver and Service not working

北城余情 提交于 2019-11-30 01:37:22
问题 I'm refactoring some code so that my app will pull data from a website once a day at a given time. From my research, it seems like AlarmManager is the most appropriate approach. The tutorial I have been following is: http://mobile.tutsplus.com/tutorials/android/android-fundamentals-downloading-data-with-services/ So far, AlarmManager and the BroadcastReceiver seem to be working, however the Service never seems to start (ie. onStartCommand doesn't seem to be called) Here are the important

Background execution not allowed receiving intent BOOT_COMPLETED

南楼画角 提交于 2019-11-30 01:24:17
问题 I've read about Android Oreo background execution limitations, and it clearly states that BOOT_COMPLETED broadcast is unaffected, but I can't get it to work on Android Oreo. First, I am compiling against SDK 27. Secondly, I declared the receiver inside the manifest file: <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <receiver android:name="helpers.StartDetectionAtBoot" android:label="StartDetectionAtBoot" android:enabled="true" android:exported="true"> <intent

Dynamic Registration vs Static Registration of BroadcastReceiver

给你一囗甜甜゛ 提交于 2019-11-30 01:23:13
问题 All of us known we register BroadcastReceiver in two types 1)Static Registration 2)Dynamic Registration But my doubt is when we need to use Static and when we need to use Dynamic ? 回答1: As we know there are two ways to register a BroadcastReceiver ; one is static and the other dynamic . Static: Use tag in your Manifest file. (AndroidManifest.xml) Not all events can be registered statically. Some events require permissions. Dynamic: Use Context.registerReceiver() to dynamically register an

Register a Local BroadcastReceiver in AndroidManifest.xml?

妖精的绣舞 提交于 2019-11-30 00:14:21
问题 Is there anyway to register a BroadcastReceiver in AndroidManifest.xml and receives broadcast that is send by a LocalBroadcastManager? Currently I must call registerReceiver(BroadcastReceiver receiver, IntentFilter filter) to register a Receiver, declare in AndroidManifest.xml won't work. But this means I must know exactly the receiver's package name and class name, not just the intent filter. Is it possible to declare the receiver in the manifest file? following is my current code.

getActiveNotifications always null when using NotificationListenerService

左心房为你撑大大i 提交于 2019-11-30 00:08:56
问题 I followed this Sample Code of kpBird and this Developer Guide I can : Call intent to this service. Can catch Broadcast from Notification. So I got the error getActiveNotifications always null . I don't know why, People who know, please help me, Thanks, p/s : Here is source code and error I get. Error : 04-28 08:46:11.625: E/AndroidRuntime(7651): FATAL EXCEPTION: main 04-28 08:46:11.625: E/AndroidRuntime(7651): java.lang.RuntimeException: Error receiving broadcast Intent { act=app.trekband

Broadcast Receiver for Sent SMS

自作多情 提交于 2019-11-29 23:26:28
问题 Is there a Broadcast Receiver in android to listen to the SMS sent event? In my application I want to count the number of SMS sent every predefined time interval. If its not possible to listen to sent sms, can anyone share code to count SMS and for specified time for example last 30 minutes. 回答1: Check this link....i think its not complete solution but you have some idea how to implement... http://www.anddev.org/other-coding-problems-f5/sms-mms-contentobserver-and-service-t12938.html you can

What triggers the BluetoothDevice.ACTION_ACL broadcasts?

筅森魡賤 提交于 2019-11-29 23:00:16
I would like to know what events in remote physical devices trigger ACTION_ACL_CONNECTED and ACTION_ACL_DISCONNECTED in a listening device. My test results make no sense. I have gathered several devices within a few decimeters of each other: a Galaxy Tab P7500 running Android 3.1 an i5500 phone running Android 2.2 a WinXP PC with a bluetooth USB dongle two headsets with on/off buttons First, I pair manually with all devices from the Tab. Neither the PC nor the phone are paired with any other device but the Tab. (One of the headsets can never be found by the tab in any way, but it can easily be

BroadcastReceiver Life Cycle — Static Variables

半世苍凉 提交于 2019-11-29 19:37:55
问题 I have a BroadcastReceiver class. I have some static variables declared whose value is updated in side the onReceive() method. As per my knowledge static variable will keep it's value across the onReceive calls. Is there any possibility when I will loose those values(Like my class will be unloaded resetting the static variables)? These are basically some temporary variables I need to be available for multiple onReceive calls. 回答1: From the documentation for BroadcastReceiver Lifecycle... A