SyntaxFix
Write A Post
Hire A Developer
Questions
This is a more simplified answer:
public String getMyPhoneNumber() { return ((TelephonyManager) getSystemService(TELEPHONY_SERVICE)) .getLine1Number(); }