广播监听拨号器onReceive无法执行

诗人夜晚 诗人夜晚 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
权限:
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>

注册:
<receiver android:name=".MyReceiver">
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL"/>
</intent-filter>
</receiver>

接收类:
public class MyReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
Log.i( "====", "onReceive: " );
}
}

运行结果没报错,点击拨号后,没有打印log
...全文
评论 4
收藏 已收藏
分享
返回顶部
诗人夜晚
Android 80,490 成员 91,375 内容