Android: How do I find the list of calls made to a particular contact?
-
08-10-2019 - |
Question
Given a contact, or a contact ID, in android, how do I get the list of calls made to or from that contact? Like the call log, but filtered to just one individual (with the possibility of multiple phone numbers, of course).
Solution
Generally, you don't. There is no strict relational tie between the CallLog
and the ContactsContract
content providers.
The CallLog
does cache the display name of the caller, if that caller was a contact, and you can try to look that up, but I would expect that to be moderately unreliable, because while the ContactsContract
data may change, the CallLog
data will not.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow