How to monitor SIM state change

后端 未结 3 1871
孤独总比滥情好
孤独总比滥情好 2020-11-27 14:15

I\'d like to be able to do some stuff when the SIM state change, i.e. play a sound when SIM PIN is required, but I think there are no Broadcast events that can be intercepte

3条回答
  •  情深已故
    2020-11-27 14:37

    The second approach of having a PhoneStateListener in a Service that listens for onServiceStateChanged() worked for me. I believe that on some devices you will not get the internal broadcast android.intent.action.SIM_STATE_CHANGED.

提交回复
热议问题