你需要注册一个 PhoneStateListener 在...上 TelephonyManager 。
TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); PhoneStateListener listener = new PhoneStateListener() { @Override public void onCallStateChanged(int state, String incomingNumber) { if (state == TelephonyManager.CALL_STATE_IDLE) { // hangup } } }; tm.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE);
要取消注册PhoneStateListener:
tm.listen(phoneListener, PhoneStateListener.LISTEN_NONE);