e.g.:
1、发送:
public static final String ACTION_REJECT = "android.intent.action.REJECT_OUTGOING_CALL";
Intent intent = new Intent(ACTION_REJECT);
mContext.sendBroadcast(intent);
2、接收:
public static final String ACTION_REJECT = "android.intent.action.REJECT_OUTGOING_CALL";
BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver(){
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if(action.equals(ACTION_REJECT)){
Log.v("sunjinbiao","handleOnscreenButtonClick");
handleOnscreenButtonClick(R.id.rejectButton);
}
}
};
IntentFilter myIntentFilter = new IntentFilter();
myIntentFilter.addAction(ACTION_REJECT);
registerReceiver(mBroadcastReceiver, myIntentFilter);
unregisterReceiver(mBroadcastReceiver);