broadcastreceiver

Logging broadcast Intents and manually trigger them (Android)

冷暖自知 提交于 2019-12-11 01:26:18
问题 during my development in android I've missed a function that can log every broadcast intent that occur. Sometimes it had been very useful to have a function like that... I'm also wondering how to trigger those broadcast intents manually on the emulator. Is there an entire overview of available broadcast intents? Would be great if someone would have some answers, greets, poeschlorn 回答1: during my development in android I've missed a function that can log every broadcast intent that occur They

SMS Sent/Delivered Broadcast Receiver [duplicate]

你离开我真会死。 提交于 2019-12-11 00:57:12
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Broadcast Receiver for Sent SMS I am currently detecting when an SMS is received through a broadcast receiver like so: <receiver android:name=".gathering.SMSNode"> <intent-filter> <action android:name="android.provider.Telephony.SMS_RECEIVED" /> </intent-filter> </receiver> Is there a similar broadcast receiver for detecting when a message is sent? 回答1: ContentResolver contentResolver = getContentResolver();

How to Set up Alarm Same like Alarm App in Android?

房东的猫 提交于 2019-12-11 00:03:34
问题 I am trying to setup alarm outside of my app with little popup box. I made that popup box by using Activity.I been trying for a long time to setup alarm like Alarm app but i get failed in some situations. I am successful if i am exiting the app from the launch activity by using back button. But when i press home button the alarm keep working charm but with last used activity in background. I am not sure why this happening and i would like to know how i can make this work with out any activity

read files in broadcast receiver

烈酒焚心 提交于 2019-12-10 22:47:52
问题 I registered a receiver in manifest file want to see if the coming sms has the message stored by my application. but I have difficulties in accessing files in the receiver. it seems since i extends BroadcastReceiver, i cannot read files. but i'm not quite sure. how somebody can help me. below is the code public class BootReceiver extends BroadcastReceiver { static final String ACTION = "android.provider.Telephony.SMS_RECEIVED"; String password; @Override public void onReceive(Context context,

Receive a notification (via BroadcastReceiver) when GPS (or location services) is started/stopped

妖精的绣舞 提交于 2019-12-10 20:37:49
问题 I tried an approach by using a BroadcastReceiver that listens for PROVIDERS_CHANGED action, but that only tells me when the location settings are turned on/off. I would like to know when the location services are being used to acquire a location by any application. I don't need to know which application is doing it, and I don't care for the location itself. I just want to know whenever some application tries to acquire a location, and when it stops doing that. Is this possible? 回答1: I don't

Broadcast Receiver not working after reboot

自作多情 提交于 2019-12-10 19:44:51
问题 I have an broadcast receiver registered in the manifest for intercepting calls, like this: <receiver android:name="CallTracker"> <intent-filter> <action android:name="android.intent.action.PHONE_STATE" /> </intent-filter> </receiver> Everything works fine and the receiver gets called. But after I restart the device or my AVD, the receiver doesn't get called anymore. What do I have to do in order to get my broadcast receiver to work after reboot, too? Do I need PackageManager for that? I like

Why isn't my local broadcast from a service being received?

左心房为你撑大大i 提交于 2019-12-10 18:49:32
问题 I have an app that includes a service ( WifiDirectFileTransferService ) and a broadcast receiver ( WifiDirectBroadcastReceiver ). The broadcast receiver is used to receive global broadcasts (for WifiP2PManager.WIFI_P2P_..._ACTION ). This part, receiving the global broadcasts, works fine. Then I tried setting up the same broadcast receiver to also receive a local broadcast, for RECEIVED_MESSAGE_DONE_ACTION . Where I was already registering the receiver for global broadcasts in my activity, I

Detect USB in Broadcastreceiver - what am I missing?

亡梦爱人 提交于 2019-12-10 18:46:40
问题 My code misses something, need your eyes to locate. I created a USBOnReciever broadcastreceiver. public class USBOnReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context, "Phone was connected to power" ,Toast.LENGTH_LONG).show(); Log.d("tag", "Phone was connected to power"); } } My manifest is: <application> <receiver android:name=".USBOnReceiver" android:enabled="true" android:exported="true"> <intent-filter> <action

How to get access to local file name in download receiver?

倾然丶 夕夏残阳落幕 提交于 2019-12-10 18:20:51
问题 I'm trying to get file path of downloaded file, i provided receiver which works but how can i get file name/path? Inside onReceive String action = intent.getAction(); if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(action)) { DownloadManager.Query q = new DownloadManager.Query(); Cursor c = this.query(q); // how to get access to this since there is no instance of DownloadManager try { String filePath = c.getString(c.getColumnIndex(DownloadManager.COLUMN_LOCAL_FILENAME)); Log.i("DOWNLOAD

How to get broadcast of new media in gallery?

 ̄綄美尐妖づ 提交于 2019-12-10 17:25:44
问题 I am trying to get notified of a new picture or video added to the phone gallery. I would need to obtain the new media's URI. The purpose is so i can automatically back it up. So i need a register that is set in the background to continuously listen or check for new media added to the gallery, and captures the Uri. This used to be done with a broadcast receiver such as: <receiver android:name=".receivers.CameraEventReceiver" android:label="CameraEventReceiver"> <intent-filter> <!-- <action