Answer the question
In order to leave comments, you need to log in
Why is it impossible to get through to the mobile after installing TelephonyManager.listen?
Please tell me why after launching the application with this code
private TelephonyManager telephonyManager;
private CallStateListener callStateListener;
public CallWatcher(Context context) {
telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
callStateListener = new CallStateListener();
}
public void startWatching() {
telephonyManager.listen(callStateListener, PhoneStateListener.LISTEN_CALL_STATE);
}
class CallStateListener extends PhoneStateListener {
@Override
public void onCallStateChanged(int state, String incomingNumber) {
super.onCallStateChanged(state, incomingNumber);
updateForCallEvent();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question