broadcastreceiver

BroadcastReceiver for Android Calendar events

天大地大妈咪最大 提交于 2019-11-28 05:30:32
I am trying to write a BroadcastReceiver that listens to events like insert, edit, delete to the native android calendar (ICS and above). So whenever one of these events occur the app should be able to at the least know that these events occurred. Any one has an idea, how to do this or any reference links. I have written my own broadcasterReceiver class that extends from BroadcastReceiver. Can't figure out the values in the manifest like, currently I have this which is not working: <receiver android:name=".NativeEventChangeReceiver"> <intent-filter> <action android:name="android.intent.action

Broadcastreceiver and Paused activity

时光怂恿深爱的人放手 提交于 2019-11-28 05:28:53
I have a broadcast receiver registered programatically in a activity. It responds to the PACKAGE_REMOVED intent, that fires when a package gets removed. The problem is, it doesn't get this message. I think this is due to that the intent is fired when I leave the activity and move to another activity to uninstall a app, so the original activity is paused. Could it be that a paused activity (where the receiver is not unregistered in onPause ) also pauses the receiver? When you register a broadcast receiver programatically in an activity, it will NOT get broadcasts when the activity is paused.

Start IntentService from Activity and refresh Activity when IntentService is finished

£可爱£侵袭症+ 提交于 2019-11-28 05:21:53
In my Android application, I have a simple list view with adapter. There's a heavy query which is to fill the list view with data. So I put it to an IntentService that runs in another thread. The IntentService is normally running separately, on its own, just to query some data and insert it into the SQLite database. But now I would like to have the following possibility: The activity starts the IntentService with startService(). The IntentService does its heavy work. When the IntentService is finished, it should inform the activity about the result so that the activity can be refreshed to show

Broadcast if a bluetooth device is connecting/disconnecting?

佐手、 提交于 2019-11-28 04:47:34
I want start a service, when a specific bluetoothdevice is connected and stop this service when it's disconnected. Obviously I don't want to have a background service that is always checking if a BT device is connected, so I want to achieve this with a Receiver. Is this actually possible? android.bluetooth.device.action.ACL_CONNECTED is mentioned here , but apparently it didn't work. Thanks! Abhinav Singh Maurya <intent-filter> <action android:name="android.bluetooth.device.action.ACL_CONNECTED" /> <action android:name="android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED" /> <action

ACTION_MY_PACKAGE_REPLACED not received

好久不见. 提交于 2019-11-28 04:42:58
I am using ACTION_MY_PACKAGE_REPLACED to receive when my app is updated or resinstalled. My problem is that the event is never triggered (I tried Eclipse and real device). This is what I do: Manifest: <receiver android:name=".MyEventReceiver" > <intent-filter android:priority="1000" > <action android:name="android.intent.action.ACTION_MY_PACKAGE_REPLACED" /> </intent-filter> </receiver> Code: public class MyEventReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if ("android.intent.action.ACTION_MY_PACKAGE_REPLACED".equals(intent.getAction())

BroadcastReceiver onReceive open dialog

烂漫一生 提交于 2019-11-28 04:37:22
问题 I'm building an android application with BroadcastReceiver and I want to show a dialog when onReceive starts. I want to show the dialog on the phone (show the user a dialog no matter where he is, like the whatsapp dialog when you get a message). How I can do that? Thanks! 回答1: If you want to show a dialog from inside your onReceive of the BroadcastReceiver, inside your broadcast receiver you may start a transparent activity with an alert dialog and NEVER called setContentView() . The activity

Incoming call broadcast receiver not working (Android 4.1)

喜夏-厌秋 提交于 2019-11-28 04:31:17
问题 I'm trying to catch an incomming call broadcast but it isn't working. This is my manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.test.bgPicture" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="9" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android

Android Best Practice on Updating the UI from BroadcastReceiver to a certain activity

╄→гoц情女王★ 提交于 2019-11-28 04:23:36
When i have a broadcastReceiver say android.intent.action.MEDIA_BUTTON and i want to update the current activity's UI without creating a new activity, is there any good practice on this one? What i know (might not be correct) 1) I can put the BroadcastReceiver in the same class as the activity and call the updateUI function after certain activity 2) Create a ContentObserver? 3) Communicate to a service created by the activity, use aidl. (I dont know how to get the current service if its registered from an activity) 4) Create a custom filter on the broadcastReceiver located on the same class as

Detect Android app upgrade and set Application class boolean for show/hide of EULA

≯℡__Kan透↙ 提交于 2019-11-28 04:22:17
I'm attempting to detect when my application has been upgraded using a BroadcastReceiver and set a boolean in my Application Class. This boolean will be used in conjunction with a few other booleans to determine whether or not to show the EULA dialog box to the user. I belive I've got it all setup correctly, but the EULA is still showing up when it shouldn't. Specifically when the user has already accepted the EULA in a previous version, the EULA hasn't changed in the version being upgraded to(Manually set by me), and the app is being upgraded. I believe the reason this isn't working is

On which thread does onReceive() of a BroacastReceiver registered with LocalBroadcastManager run?

夙愿已清 提交于 2019-11-28 03:07:20
问题 I register a broadcast receiver in a preference activity and send it a (sync) broadcast from a (Wakeful) IntentService. Apparently onReceive runs on the service's thread. Is this a fault of my part ? Is it documented behavior ? Preference activity: public final class SettingsActivity extends BaseSettings { private static CharSequence sMasterKey; private CheckBoxPreference mMasterPref; // Receiver /** If the master preference is changed externally this reacts */ private BroadcastReceiver