@ Override
Public void onCallStateChanged (int, String incomingNumber) {
If (lastState==TelephonyManager. CALL_STATE_RINGING & amp; &
State==TelephonyManager. CALL_STATE_IDLE) {//the current status for free, but the last time for the ring, not call for judgment for
The d (" MainActivity ", "phone number:" + incomingNumber);
}
LastState=state;
Super. OnCallStateChanged (state, incomingNumber);
}
The Log print is as follows:
10:38:21 12-14, 607, 9291-9291/com. Smstest D/MainActivity: phone number:
Beg god to explain, don't appreciate
CodePudding user response:
The d (" MainActivity ", "phone number:" + incomingNumber); On the conditions outside the interview aboutWhether CALL_STATE_IDLE is no number or permissions
CodePudding user response:
On the outside, like huawei mobile phones, is to get the incomingnumber, but millet mobile phone is Null, custom reason feel system?CodePudding user response:
Yes, this is not clear, may I this millet, you go and ask the milletCodePudding user response:
To solve the ahCodePudding user response:
Hello, the problem you solve, I encountered this problem now, now I hand millet mobile phone can't get to incomingNumber 6, return is emptyCodePudding user response:
Need to get READ_CALL_LOG permissions (directory) can