In Android, how can one add and remove a contact or a phone number from/to the black list. Is there API for that? Surprisingly, I haven't found anything about the matter.
Asked
Active
Viewed 719 times
3
-
you can create your own custom list for blacklist number and create a broadcast receiver for incoming call events and check for number – Vivek Mishra Dec 31 '15 at 07:03
-
see also http://android.stackexchange.com/a/16286/6035 – Dec 31 '15 at 07:05
-
@VivekMishra, will the standard built-in Android call manager remain functional if I create such a broadcast receiver to intercept the incoming calls? – Dec 31 '15 at 07:19
-
1Yes,It will be functional – Vivek Mishra Dec 31 '15 at 07:22
-
@VivekMishra, actually, I need to add a person to the blacklist when a user rejects a call in the built-in call manager depending on some conditions. Can I do that and how? – Dec 31 '15 at 10:30
-
just as true caller do if user rejects a call capture that event and get that phone number and then show popup to user if they want to add that number to blacklist or not. In this caase you have to store your list in database also – Vivek Mishra Dec 31 '15 at 10:32
-
@VivekMishra, how can I capture the event of rejecting a call? – Dec 31 '15 at 10:41
-
http://stackoverflow.com/questions/9684866/how-to-detect-when-phone-is-answered-or-rejected check this link – Vivek Mishra Dec 31 '15 at 10:51
-
@VivekMishra, thank you. – Dec 31 '15 at 10:57
-
let me post it as an answer – Vivek Mishra Dec 31 '15 at 10:59
1 Answers
2
Create your own custom list for blacklist number and create a broadcast receiver for incoming call events and check for number. if user rejects a call capture that event and get that phone number and then show popup to user if they want to add that number to blacklist or not. In this case you have to store your list in database also. For capturing accept or reject events follow this link Detecting call reject event

Community
- 1
- 1

Vivek Mishra
- 5,669
- 9
- 46
- 84