I am very sorry if this is a duplicate post, but believe me I did a lot of searching. Way back in android 2.2 I had an application with a static broadcast receiver that would get called each time a new text message arrived, regardless of applications state.
Now, I am trying to have same behavior, but on android 5 (I believe this to be post 4.4 thing). As soon as my app is closed from recent apps, static receiver stops working.
Is this how Android works now? I have found one answer on stackoverflow saying that this is so, but I saw no documentation.
Perhaps something is missing here:
<receiver
android:name="com.dimitar.android.test.comm.ControlMessagesReceiver"
android:exported="true"
android:enabled="true"
android:permission="android.permission.BROADCAST_SMS" >
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
If so, then my only idea is to listen to boot event and start a service to handle what I need.