@Override public void onReceive(Context context, Intent intent) { String number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER); String address = NumberAddressDao.findAddress(NumberAddressService.this, number); mToast.show(address); }
@Override public void onCallStateChanged(int state, String incomingNumber) { // 响铃状态显示号码归属地 if (state == TelephonyManager.CALL_STATE_RINGING) { String address = NumberAddressDao.findAddress(NumberAddressService.this, incomingNumber); mToast.show(address); } else if (state == TelephonyManager.CALL_STATE_IDLE) { mToast.hide(); } }