尝试拦截外拨电话,已经在以下设备上成功实现:
- nexus 1,安卓2.2系统
- HTC desire,2.2系统
- Moto defy,2.1系统
但是在运行2.1系统的三星Galaxy S上无法实现,有人遇到过这个问题吗?
<receiver android:name="com.mypackge.OutGoingCallDetection"
android:exported="true">
<intent-filter>
<action
android:name="android.intent.action.NEW_OUTGOING_CALL"
android:priority="0" />
</intent-filter>
</receiver>
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
更新:已添加 PROCESS_OUTGOING_CALLS。
接收器:
public class OutGoingCallDetection extends BroadcastReceiver {
private static final String TAG = "OutGoingCallDetection";
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
Log.d(TAG, "onReceive, Action:" +intent.getAction());
}
}