Retrieve incoming call's phone number in Android

我只是一个虾纸丫 提交于 2019-11-26 00:59:00

Use PhoneStateListener. It has an onCallStateChanged handler; one of the supplied arguments you'll get is a String containing the incoming phone number.

mikeplate

Your overridden method in CustomPhoneStateListener should be called onCallStateChanged() (and not onCallStateChange()).

This would have been spotted by the Java compiler if you would have had the @Override annotation, like you have for onReceive().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!