How to determine the number of minutes the user is being in a GSM call?
问题 I'm trying to determine for how long a user has been in a GSM call. Is that possible using the TelephonyManager?Thank you. 回答1: You can set a listener on TelephonyManager. Try this. long startCallTime = 0; private void setTelephonyManagerCallListener(){ TelephonyManager tm = (TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE); tm.listen(phoneCallStateListener, PhoneStateListener.LISTEN_CALL_STATE); } private PhoneStateListener phoneCallStateListener = new PhoneStateListener(){