android获取当前手机号示例程序

时间:2022-09-20 13:10:23
复制代码 代码如下:

/*
         * 获取当前的手机号
         */
        public String getLocalNumber() {
                TelephonyManager tManager = (TelephonyManager) this
                                .getSystemService(TELEPHONY_SERVICE);
                String number = tManager.getLine1Number();
;                return number;
        }