google libphonenumber仅从联系人获取手机号码 [英] google libphonenumber get only mobile numbers from contacts

查看:96
本文介绍了google libphonenumber仅从联系人获取手机号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用libphonenumber格式化联系人中的电话号码.有什么方法可以只显示手机号码,例如WhatsApp?没有本地电话号码.

I'm using libphonenumber to format phonenumbers in contacts. Is there any way to display only mobile numbers like WhatsApp? no local phone numbers.

我唯一的想法是列出所有移动电话区号,例如 https://en. wikipedia.org/wiki/List_of_mobile_phone_number_series_by_country 并检查每个数字,但是我认为这有点复杂.

The only idea I have is to have a list with all mobile area codes like https://en.wikipedia.org/wiki/List_of_mobile_phone_number_series_by_country and check every number but this is a bit complicated I think.

推荐答案

找到了答案...

PhoneNumberUtil.PhoneNumberType nrtype = phoneUtil.getNumberType(NumberProto);
if (nrtype.name() == PhoneNumberUtil.PhoneNumberType.MOBILE) {
}

这篇关于google libphonenumber仅从联系人获取手机号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆