从新的拨出呼叫意图中获取额外的电子邮件
我正在编写一个响应 NEW_OUTGOING_CALL 操作的 BroadcastReceiver。这意味着,每次用户拨打新电话时,我的 BroadcastReceiver 都会被调用。
我想获取用户呼叫的联系人的电子邮件。
以下是我可以从意图中获得的额外内容: 捆绑包[{android.phone.extra.ALREADY_CALLED=false, android.intent.extra.PHONE_NUMBER=123, android.phone.extra.ORIGINAL_URI=tel:123}]
有什么想法吗?谢谢。
I'm writing a BroadcastReceiver that responds to the NEW_OUTGOING_CALL action. Meaning, every time the user makes a new phone call - my BroadcastReceiver is called.
I want to get the email of the contact the user is calling.
Here are the extras I can get from the intent:
Bundle[{android.phone.extra.ALREADY_CALLED=false, android.intent.extra.PHONE_NUMBER=123, android.phone.extra.ORIGINAL_URI=tel:123}]
Any ideas? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要查看 Contacts API,它允许您以不同的方式查找各种联系信息。然后也许可以通过 PhoneLookup 表快速查找联系人电话号码的 id。
如果您还没有使用过
Contacts
API,请准备好学习一些“有趣”的方法,并记住,在幕后,这一切都只是关于构建select
数据库表的语句。 - 但请亲自查看:使用联系人 API。You may want to have a look at the Contacts API which allows you to look up various contact informations in different ways. And then maybe go via the PhoneLookup table to quickly find a contact id for a phone number.
If you haven't used the
Contacts
API be prepared to learn some 'interesting' approaches and bear in mind that, more and less behind the scenes, it's all only about buildingselect
statements for DB tables. - But see for yourself: Using contacts API.