android-broadcastreceiver

Can non-default SMS app ALWAYS receive broadcast when SMS received, even when force closed?

北战南征 提交于 2019-12-10 20:13:20
问题 So I have followed this guideline to show a simple toast when SMS is received. While it works ok when app is running, when I go to settings and force-close the app, it stops working. I checked many answers here on StackOverflow for simmilar questions, but none actually answers whether (and how) it is possible to make a piece of code execute EVERY time SMS is received, without the app being set as the default SMS app on device (Android 4.4+). Is it? Consider that even service can be stopped,

I always see “E ActivityManager: Sending non-protected broadcast from system” in android 7. What does this mean?

爷,独闯天下 提交于 2019-12-10 18:59:00
问题 I am trying to send an intent from a non system app using the following function. public static void sendIntent() { if (null != _context) { Intent intent = new Intent("com.test.testApp.testIntent"); intent.setPackage(_context.getPackageName()); _context.sendBroadcast(intent); } } But I always see there is an error message from ActivityManager as below. The same intent broadcasting(app) works fine in andorid 6.0 but throws an error in android 7.1.1. I am required to change anything for android

BroadcastReceiver is not called after createChooser(context,intent,IntentSender) is executed

早过忘川 提交于 2019-12-10 14:13:55
问题 I want to detect what app the user selects after I present him with a createChooser() dialog. So I have created my BroadcastReceiver subclass like this: import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; public class ShareBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Log.d("INFORMATION", "Received intent after selection: "+intent.getExtras().toString

SUPPLICANT_CONNECTION_CHANGE_ACTION never received

允我心安 提交于 2019-12-10 14:09:51
问题 I am looking to be notified when the device switches networks but for some oddball reason, in spite of the documentation and various examples on SO, this particular action never gets sent to my receiver. Here's my code RECEIVER: BroadcastReceiver connectedToLocalWifiReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); Log.d(TAG, "ACTION='" + action +"'"); //<-- WifiManager.SUPPLICANT_CONNECTION_CHANGE

Bluetooth Device Button Press Should Trigger Onclick Listener in the app

拈花ヽ惹草 提交于 2019-12-10 13:22:47
问题 I'm trying to make an app which triggers an on click listener in the app when a button is pressed on the paired bluetooth device. After googling for several hours I think I am unable to send keycode of the button of the bluetooth device to broadcast receiver where if the keycode matchs then i can call the on click listener or maybe my approach and understanding is wrong so Could anyone please guide me or point me towards the right approach? Thanks in advance Bluetooth device: Bluetooth Selfie

Broadcast receiver is not calling on internet connectivity check

人盡茶涼 提交于 2019-12-08 10:43:10
问题 I am trying to make a simple app which will notify if there is internet connection available or not on internet connectivity change. i have found some solution on internet and tries to implement them but somehow its not working. my broadcast receiver which i have registered on my manifest file is not calling on network connectivity change. Manifest <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses

Autostart (BOOT_COMPLETED) does not work on the Nomi tablet

独自空忆成欢 提交于 2019-12-08 03:22:17
问题 My broadcast receiver triggered by event BOOT_COMPLETED and works fine on many devices except Nomi C10103. The message appears in the log on the device: D/ActivityManager: send broadcast: android.intent.action.BOOT_COMPLETED, skip package: com.example.myPackageName Sending message am broadcast -a android.intent.action.BOOT_COMPLETED com.example.myPackageName from adb shell also does not run the application. Manifest code: <receiver android:name=".AutoRunReceiver"> <intent-filter android

Android BroadcastReceiver onReceive() called twice on android 5.1.1 even after one register

萝らか妹 提交于 2019-12-07 08:13:51
问题 I Could not figure out what is wrong with below code. I also checked about registering receiver twice. But that's also not the case. or may be I am missing something. Could any please help. I really need it. :( import android.app.Service; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.os.IBinder; import android.telephony.TelephonyManager; import android.util

Why LocalBroadcastManager is not working in service?

有些话、适合烂在心里 提交于 2019-12-07 08:00:29
问题 I used Service and i am not recieving any broadcasted message. Need quick response. This is the intent filter string i used. public class AppConstant { public static final String FILTER = "com.sample.hmi.REQUEST_PROCESSED" ..... } My service look like this public class MyService extends Service { ..... { ..... broadcastResponse(true);//bradcastcall .... } private void broadcastResponse(boolean isTrue) { Intent intent = new Intent(AppConstant.FILTER); intent.putExtra(AppConstant.COMMAND,

Alarm Manager not working at specific given time interval

雨燕双飞 提交于 2019-12-07 06:49:17
问题 Hi I am using alarm Manager for specific time interval for 3 minutes and I started monitoring. It worked for sometimes and suddenly I noticed there is irregular time interval which is not correct! You can see in attached log where at "20-Jul-2016 12:22:03 pm" time varies! I connected the phone and turned off the screen and monitored! where for every 3 minutes, i hit the server and gets the response as 1. But at one time, it takes 5 minutes to hit the server! Why this strange issue happened?