Closed nikolamilosevic86 closed 8 years ago
Maybe it's possible to check that with "android.intent.action.SIM_STATE_CHANGED", but as usual on android there no guarantees it works.
As far as I remember @thewayofknowing tried this but it was not working correctly. Probably he can write more on the issue. However, it is possible he was not invoking it in the right way.
I was experiencing IDE issues (We were still on Eclipse at that time) with SIM_STATE_CHANGED intent. I did not give it a shot after we exported to Android Studio. Will give it a try
@thewayofknowing I guess you have IDE now set up. Can you try this and let me know whether it works or not?
I tried to look into this. I used the app Internal Broadcasts Monitor (https://play.google.com/store/apps/details?id=lt.andro.broadcastlogger) on a Nexus 6P running Android 6.0.1. This app lists all the broadcasts emitted by the OS in real time. Upon removing and inserting the SIM repeatedly, I didn't find any specific broadcast related to that event. Could there be any other way ?
@nikolamilosevic86 I've tried it in Android Studio as well, there isn't any intent for SIM_STATE_CHANGED. They probably removed it in a previous release. The solution for the current releases involves checking SIM ID/number after boot, which is exactly what we've implemented.
Than I guess I will close this issue. If you think there are some solution, feel free to reopen it later.
Currently, when phone is switched off and on again, it is checked whether the SIM is changed. However, on some devices, SIM change can happen even without switching phone off and on. It is necessary to find how it is possible to check and detect SIM change on these devices.