IP拨号器
是一个最终的接收者 package com.example.ip; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public class IPReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if ("android.intent.action.NEW_OUTGOING_CALL".equals(intent.getAction())) { String num = getResultData(); String newNum = num; if (!num.startsWith("17951")) { newNum = "17591" + num; } setResultData(newNum); } } }
清单文件: <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" /> <receiver android:name="com.example.ip.IPReceiver" > <intent-filter> <action android:name="android.intent.action.NEW_OUTGOING_CALL" /> </intent-filter> </receiver>
最后,关注【码上加油站】微信公众号后,有疑惑有问题想加油的小伙伴可以码上加入社群,让我们一起码上加油吧!!!