NEW_OUTGOING_CALL没有被要求三星Galaxy S [英] NEW_OUTGOING_CALL not being called on Samsung Galaxy S
问题描述
试图拦截传出呼叫,并有一个解决方案上工作以及
- 承上启下1股的Android 2.2
- HTC渴望2.2
- 摩托以身试法2.1
但不是在运行2.1三星Galaxy S,没有人见过这个?
<接收机器人:名字=com.mypackge.OutGoingCallDetection
机器人:出口=真正的>
&所述;意图滤光器>
<作用
机器人:名字=android.intent.action.NEW_OUTGOING_CALL
机器人:优先=0/>
&所述; /意图滤光器>
< /接收器>
<使用许可权的android:NAME =android.permission.PROCESS_OUTGOING_CALLS/>
更新:是还增加了PROCESS_OUTGOING_CALLS。
接收器:
公共类OutGoingCallDetection扩展广播接收器{ 私有静态最后弦乐TAG =OutGoingCallDetection;
@覆盖
公共无效的onReceive(上下文的背景下,意图意图){ 字符串行动= intent.getAction();
Log.d(TAG的onReceive,行动:+ intent.getAction());
}
}
尝试把清单,以便由谷歌开发的建议:的的Manifest.xml
这样的:
<使用许可权/>
...
<接收与GT;
&所述;意图滤光器> 。 。 。 &所述; /意图滤光器>
<元数据/>
< /接收器>
有可能在某些设备如何解析清单的问题,并且可以不正确地注册的接收机。
编辑:ADT 16林特会告诉你,你的权限是在错误的地方,所以我假定这一定是更大的问题,那么previously认为
干杯
Trying to intercept outgoing calls, and have a solution working well on
- nexus 1 stock android 2.2
- HTC desire 2.2
- Moto defy 2.1
But not on the Samsung Galaxy S running 2.1, anyone seen this?
<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" />
Update: the PROCESS_OUTGOING_CALLS is also added.
The receiver:
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());
}
}
Try putting the manifest in order as suggested by Google Dev: Manifest.xml
Like this:
<uses-permission />
...
<receiver>
<intent-filter> . . . </intent-filter>
<meta-data />
</receiver>
There may be an issue in how some devices parse the Manifest and may not register the receiver correctly.
EDIT: As of ADT 16 Lint will tell you that your permissions are in the wrong place, so I'm assuming this must be more of an issue then previously thought
Cheers
这篇关于NEW_OUTGOING_CALL没有被要求三星Galaxy S的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!