private static final String CALLACTION = "android.intent.action.PHONE_STATE";
然后我注册它
final IntentFilter theCallFilter = new IntentFilter();
theCallFilter.addAction(CALLACTION);
yourCallReceiver = new CallReceiver();
// Registers the receiver so that your service will listen for broadcasts
registerReceiver(yourCallReceiver, theCallFilter);
后来我检查了
if(intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")) { ... }
但我也可以检查一下是否是
android.intent.action.NEW_OUTGOING_CALL
或来电或是否挂断...?如果是的话,如何在这个PHONE_STATE
活动中