Import the required class.
Phone.getDevicePhoneNumber(), passing in
true to return the phone number in its regional
String phNumber = Phone.getDevicePhoneNumber(true);
- Check for ControlledAccessException to catch instances where your application does not have permission to access the phone number information.
Next topic: Retrieve a call by call ID
Previous topic: Retrieve call information