I have looked into several similar questions on SO, tried all possible tweaks and changes after referring to countless tutorials, and answers in SO but my receiver is not being called on PHONE_STATE change.
I have already seen the answers here, here and here.
This is my AndroidManifest.xml
file.
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
.....
<receiver android:name=".CustomReceivers.MissedCallReceiver" android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE"/>
</intent-filter>
</receiver>
.....
This is my BroadcastReceiver.
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
public class MissedCallReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "Activated", Toast.LENGTH_SHORT).show();
}}
There is absolutely no error being shown anywhere. I tried calling from another device while the application is active, still there seems to be no change.