简体   繁体   English

我在想什么android.telephony.PhoneNumberUtils

[英]what am i missing android.telephony.PhoneNumberUtils

i have an android app that needs to listen for incoming sms messages. 我有一个Android应用程序,需要监听传入的短信。 i then need to display the senders name associated with the sending telephone number. 然后,我需要显示与发送电话号码关联的发送者姓名。 my probelm is that the originating address has the country code prefix, where as my contacts does not. 我的探究是发件人的地址具有国家/地区代码前缀,而我的联系人没有。

how can i cope with this situation? 我该如何应对这种情况? i was hoping 我希望

android.telephony.PhoneNumberUtils
could help but none of its methods seems to be of any use in this case. 可能有帮助,但在这种情况下,它的任何方法似乎都没有用。

surely there must be some android utilities that can convert between numnbers with and without country code prefixes. 当然,必须有一些android实用程序可以在带和不带国家/地区代码前缀的数字之间进行转换。

for example the smsManager always appears to give me originatingaddress with +44 prefix, whereas some of my personal contacts do not have this prefix attached. 例如,smsManager总是给我提供带有+44前缀的原始地址,而我的某些个人联系人没有附加此前缀。 am i going to have to code a conversion prcess myself? 我是否必须自己编写一个转换过程代码? or use a LIKE predicate when using contentResolver to get my telephone contact display name? 或在使用contentResolver来获取我的电话联系人显示名称时使用LIKE谓词?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM