broadcastreceiver

How can I make this phone call states Broadcast receiver to work all the times?(non-stops)

﹥>﹥吖頭↗ 提交于 2020-08-20 06:38:19
问题 I'm creating an application, which will show toast messages before and after the call states. I generated and installed my application on my mobile. it was working well after a few days or sometimes a few hours. but after that, it's stopped, in order to run the application I need to open the application again. how can I modify my application to work very well? Thank you manifest <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android

Can't do heavy work on broadcast receiver which is inside the Service

岁酱吖の 提交于 2020-08-15 06:00:05
问题 I created a Broadcast Receiver Which is inside the Service Class (Because of the Android Broadcast receiver restrictions Broadcast receiver stops after while, So I created Background Service , with foreground Service Notification Restriction in Android Oreo=< ). This Broadcast Receiver Listens to Phone Call States Changes IDLE, OFFHOOK, RINGING . According to the Phone call states changes(If the call ends), I get the last call details in the Cursor and Send to that details into the Firebase

Can't do heavy work on broadcast receiver which is inside the Service

不想你离开。 提交于 2020-08-15 05:59:51
问题 I created a Broadcast Receiver Which is inside the Service Class (Because of the Android Broadcast receiver restrictions Broadcast receiver stops after while, So I created Background Service , with foreground Service Notification Restriction in Android Oreo=< ). This Broadcast Receiver Listens to Phone Call States Changes IDLE, OFFHOOK, RINGING . According to the Phone call states changes(If the call ends), I get the last call details in the Cursor and Send to that details into the Firebase

SMS BroadcastReceiver stops working after sometime

旧时模样 提交于 2020-07-20 04:40:30
问题 I have an app which does some task once it receives a SMS. I have implemented it using BroadcastReceiver. After installing the app, it works fine for sometime. Afterwards, I notice that onReceive event of BroadcastReceiver is not triggered. To troubleshoot, I restarted my app service and connected the mobile to Android Studio Logcat. As earlier, initially it detected new SMS and everything worked fine. When I sent SMS after 30 mins, onReceive event was not triggered. There was no messages

BroadcastReceiver not firing on notification action click

被刻印的时光 ゝ 提交于 2020-06-16 05:06:48
问题 I am trying to create a simple notification with a button (action) defined to it. I have managed to display it properly and create a PendingIntent for my action. I have also created a BroadcastReceiver which is supposed to be called when my action is clicked. But it's onReceive() method does not get called. I have no idea why. I also registered BroadcastReceiver in AndroidManifest.xml MainActivity.java public class MainActivity extends AppCompatActivity { @Override protected void onCreate

How to handle AT commands from a Bluetooth headset in Android?

ぃ、小莉子 提交于 2020-06-16 05:04:11
问题 I would like to handle an AT command (for double tap event) from a standard Bluetooth mono headset. By default, the double tap sends AT+BLDN command (Redial event) to the phone. According to Android documentation, registering a Broadcast Receiver for android.bluetooth.headset.action.VENDOR_SPECIFIC_HEADSET_EVENT will handle all such vendor related AT commands. But, it is not being invoked when the AT command is sent by the headset. Though, the redial event happens on the phone. 回答1: AT+BLDN

How to handle AT commands from a Bluetooth headset in Android?

谁说我不能喝 提交于 2020-06-16 05:04:07
问题 I would like to handle an AT command (for double tap event) from a standard Bluetooth mono headset. By default, the double tap sends AT+BLDN command (Redial event) to the phone. According to Android documentation, registering a Broadcast Receiver for android.bluetooth.headset.action.VENDOR_SPECIFIC_HEADSET_EVENT will handle all such vendor related AT commands. But, it is not being invoked when the AT command is sent by the headset. Though, the redial event happens on the phone. 回答1: AT+BLDN

Unable to instantiate receiver, java.lang.IllegalAccessException: access to class not allowed

青春壹個敷衍的年華 提交于 2020-06-08 17:28:30
问题 In the manifest I've declared the receiver element correctly to the best of my knowledge. But the Receiver never gets called when I send out the broadcast. The log cat shows. 07-22 23:51:49.181: E/AndroidRuntime(3799): FATAL EXCEPTION: main 07-22 23:51:49.181: E/AndroidRuntime(3799): java.lang.RuntimeException: Unable to instantiate receiver com.example.orderedbroadcastreceiver.HigherPriorityReceiver: java.lang.IllegalAccessException: access to class not allowed 07-22 23:51:49.181: E

Backgroundservice is running, but not working (FileObserver)

♀尐吖头ヾ 提交于 2020-05-15 21:46:05
问题 I want to run a Backgroundservice (FileObserver) that will look for any filechanges in the system (CREATE, DELETE, MOVE, ...). When I start my application it works a few seconds and logs everything fine. For example at taking a picture by the camera it logs that. After a few seconds the service is still listed in Settings => Developer Options => Running Services but does not work and log anything anymore. Android Version: 7.0 Device: Samsung Galaxy S7 Edge I copied the code from Niza Siwale's

Broadcast receiver is not working in oreo and pie android

拈花ヽ惹草 提交于 2020-05-09 06:37:10
问题 Boot broadcast receiver is not working and there is nothing in onReceive() public class BootReceived extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { Toast.makeText(context, intent.getAction(), Toast.LENGTH_LONG).show(); Log.d("IfWalaBooot", intent.getAction()); Intent intent1 = new Intent(context, MainActivity.class); intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context