尝试截取传出的电话,并有一个解决方案工作良好。
但在三星Galaxy的2.1版上,有人看到了这个吗?
<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());
}
}发布于 2011-07-15 13:11:58
按照Google:Manifest.xml的建议,尝试按顺序排列清单
如下所示:
<uses-permission />
...
<receiver>
<intent-filter> . . . </intent-filter>
<meta-data />
</receiver>在某些设备如何解析Manifest并可能无法正确注册接收器时可能会出现问题。
编辑:从ADT16Lint开始,Lint会告诉您您的权限位于错误的位置,所以我假设这肯定是一个比以前认为的更大的问题
干杯
发布于 2011-07-14 21:20:42
您需要添加用户权限:
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" /> 请参阅这篇博客文章作为如何设置和使用NEW_OUTGOING_CALL的示例。
还请参阅这篇博客文章关于将android:priority设置为什么。
发布于 2011-07-14 18:30:29
你试过增加android:priority吗?比方说多达10000。
我在截取短信,增加android:priority属性是有帮助的
https://stackoverflow.com/questions/6696652
复制相似问题