* Registers a listener object to receive notification of changes
* in specified telephony states.
* To register a listener, pass a {@link PhoneStateListener}
* and specify at least one telephony state of interest in
* the events argument.
* At registration, and when a specified telephony state
* changes, the telephony manager invokes the appropriate
* callback method on the listener object and passes the
* current (udpated) values.
* To unregister a listener, pass the listener object and set the
* events argument to {@link PhoneStateListener#LISTEN_NONE LISTEN_NONE} (0)


telManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
				psListener = new PhoneStatusListener();
				telManager.listen(psListener, PhoneStateListener.LISTEN_CALL_STATE);  //监听
telManager.listen(psListener, PhoneStateListener.LISTEN_NONE);  //取消监听

相关文章:

  • 2021-10-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
猜你喜欢
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2021-11-10
  • 2022-02-19
  • 2021-12-17
相关资源
相似解决方案