我在我的 logcat 中遇到了这个错误
TelephonyManager : Hidden constructor called more than once per process!
我PhoneListener
的不工作
@Override
public void onCallStateChanged(int state, String incomingNumber) {
switch (state) {
case TelephonyManager.CALL_STATE_IDLE:
Log.e("state", "idle");
break;
case TelephonyManager.DATA_CONNECTED:
Log.e("state", "connected");
break;
}
};
};
telManager = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
telManager.listen(callListener, PhoneStateListener.LISTEN_CALL_STATE);
它不会打印出我的日志。