So now I have my BroastcastReceiver declared in the manifest file...
<receiver android:name=".MyReceiver">
<intent-filter>
<action android:name="android.intent.action.CALL_BUTTON" />
</intent-filter>
</receiver>
I want to catch the intent when the Call button is pressed.
Here is my code...
public class MyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "intent received", Toast.LENGTH_LONG);
if(intent.getAction().equals("android.intent.action.CALL_BUTTON")) {
Toast.makeText(context, "call button pressed", Toast.LENGTH_LONG);
}
}
}
However, I don't see the toast when I hit the call button. Did I miss something?
This is a continuation using an answer from this question...
How to use Intents from a Service or Broadcast Receiver?