broadcastreceiver

Broadcast Receiver Register in Manifest vs. Activity

旧巷老猫 提交于 2019-12-27 13:35:14
问题 I need some help to understand when I can expect my broadcast receiver will work when just registered in the manifest versus having to be registered from a running activity or service. So for example if I register a stand alone receiver with the following intent filter it works without having a service/activity reference to it: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.blk_burn.standalonereceiver" android

Broadcast Receiver within a Service

半世苍凉 提交于 2019-12-27 10:45:08
问题 I am trying to start up a BroadcastReceiver within a Service . What I am trying to do is have a background running service going that collects incoming text messages, and logs incoming phone calls. I figured the best way to go about this is to have a service running that incorporates a broadcast receiver that can catalog either. How do i go about doing this? I already have my service up and running. 回答1: as your service is already setup, simply add a broadcast receiver in your service:

Broadcast Receiver within a Service

a 夏天 提交于 2019-12-27 10:44:22
问题 I am trying to start up a BroadcastReceiver within a Service . What I am trying to do is have a background running service going that collects incoming text messages, and logs incoming phone calls. I figured the best way to go about this is to have a service running that incorporates a broadcast receiver that can catalog either. How do i go about doing this? I already have my service up and running. 回答1: as your service is already setup, simply add a broadcast receiver in your service:

AudioManger doesn't Work Application Crashes

帅比萌擦擦* 提交于 2019-12-25 18:38:14
问题 I'm working on an application .. but Audiomanager is not working i can't see any error my application got crash on phone I'm using AudioManager in BroadCastReciver Class when sms recive and text of sms is same of the particular text i've set the volume should be change silent to Normal mode. if(message.equals(pwd)) { AudioManager au; au = (AudioManager)getSystemService(Context.AUDIO_SERVICE); au.setRingerMode(AudioManager.RINGER_MODE_NORMAL); // Show Alert int duration = Toast.LENGTH_LONG;

BroadcastReceiver in android 7.0

て烟熏妆下的殇ゞ 提交于 2019-12-25 17:38:13
问题 I am working with a broadcastreceiver in android 7 but it is not working properly so Do we need to register the broadcastreceiver using registereceiver() inorder to work with broadcast reviver in android 7. 回答1: There are only 2 changes related to broadcast receivers in android 7: Apps targeting Android 7.0 (API level 24) and higher do not receive CONNECTIVITY_ACTION broadcasts if they declare their broadcast receiver in the manifest. Apps will still receive CONNECTIVITY_ACTION broadcasts if

BroadcastReceiver in android 7.0

强颜欢笑 提交于 2019-12-25 17:37:27
问题 I am working with a broadcastreceiver in android 7 but it is not working properly so Do we need to register the broadcastreceiver using registereceiver() inorder to work with broadcast reviver in android 7. 回答1: There are only 2 changes related to broadcast receivers in android 7: Apps targeting Android 7.0 (API level 24) and higher do not receive CONNECTIVITY_ACTION broadcasts if they declare their broadcast receiver in the manifest. Apps will still receive CONNECTIVITY_ACTION broadcasts if

Android - Listening to a locale change without static variables

◇◆丶佛笑我妖孽 提交于 2019-12-25 15:53:55
问题 I have a BroadcastReceiver that listens to a locale change. Here's my problem: I navigate to an Activity and then want to change locale (language setting) which I do by going to the settings app. The BroadcastReceiver then listens in onReceive() once a change is made. I then navigate back to the app and when I do so I'd like to take a user to another Activity . Also, a locale modification corresponds to a change in configuration which means an Activity will be destroyed and created again.

Android - Listening to a locale change without static variables

半世苍凉 提交于 2019-12-25 15:52:57
问题 I have a BroadcastReceiver that listens to a locale change. Here's my problem: I navigate to an Activity and then want to change locale (language setting) which I do by going to the settings app. The BroadcastReceiver then listens in onReceive() once a change is made. I then navigate back to the app and when I do so I'd like to take a user to another Activity . Also, a locale modification corresponds to a change in configuration which means an Activity will be destroyed and created again.

How to collect logs for every event which occurs in android device?

血红的双手。 提交于 2019-12-25 14:20:11
问题 I wanted to collect log for every event which occurs in android device like when user starts any application or when any application have notification for user. Currently I have broadcast receiver listening for every event but it did not listened to certain events, so I searched on internet and it suggested to give priority to events while registering then in manifest file. Now the question is should I give priority to every event and if yes what priority should I give them. Thanks. 回答1:

Receive SMS after closing App in Android

大憨熊 提交于 2019-12-25 09:27:52
问题 I need to read incoming SMS. I'm using BroadcastReceiver for this. It's working fine but when app is closed BroadcastReceiver also close. Here is code that I'm using. Manifest <uses-permission android:name="android.permission.SEND_SMS"/> <uses-permission android:name="android.permission.RECEIVE_SMS"/> <uses-permission android:name="android.permission.READ_SMS"/> <!--other code --> <receiver android:name=".IncomingSms"> <intent-filter> <action android:name="android.provider.Telephony.SMS