有些情况下,我不想监听手机的状态。如何销毁PhoneStateListener类的对象?
我是这样创建对象的:
try {
phoneCallListener = new WnetPlayerPhoneCallListener();
TelephonyManager mTM = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
mTM.listen(phoneCallListener, PhoneStateListener.LISTEN_CALL_STATE);
} catch(Exception e) {
Log.e("PhoneCallListener", "Exception: "+e.toString());
}