【发布时间】:2011-07-14 16:25:20
【问题描述】:
试图拦截拨出电话,并有一个很好的解决方案
- nexus 1 stock android 2.2
- HTC 渴望 2.2
- 摩托无视 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());
}
}
【问题讨论】: