'Check Registered Number Sim is inserted or not
I am trying to validate the user has the sim card in their android phone's sim slot while using our application Like GPay, the Phonepay app will throw an error when we removed the sim card from the device
In most cases, I am getting security exceptions and a blank or null string in the latest android versions
TelephonyManager tMgr = (TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE);
String mPhoneNumber = tMgr.getLine1Number();
Solution 1:[1]
I think a major part of your problem's solution is available here: link
Check it out.
Hope it solves the issue.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | S-Men |
