Zach S.
Zach S.

Reputation: 130

Contacts Provider: How to hide Contacts by default from List

This may not be something that is possible but I have tried a few things.

I have attempted to set the contacts from my provider into a group that is set to not visible (GROUP_VISIBLE, 0). However, without fail they still show up in the contacts list.

Also, I have set the contacts to have a setting to not be visible and to not show ungrouped contacts and tried several variations of grouping/ungrouping.

Essentially, my goal is to have contacts that primarily are just used for CallerId.

Ideas, thoughts?

Upvotes: 0

Views: 804

Answers (1)

marmor
marmor

Reputation: 28229

Contact apps usually allow the user to select the display options he/she likes.

Contact apps are different between different devices, but the options are usually:

  1. Display all contacts (ignoring GROUP_VISIBLE)
  2. Display visible groups only (usually referred to as "custom" allowing the user the make certain groups visible or not)
  3. Display a specific group.

By making your contacts in hidden groups you'll be hiding them for some of your users, but not all, also, users could still select a checkbox to make your contact groups visible.

What most caller-ID apps do, is register for incoming-call events, and display a popup with the caller-ID info on top of the stock incoming call screen.

You can use WindowManager.LayoutParams.TYPE_SYSTEM_ALERT to make a view always-on-top so it's above the incoming call screen (like Facebook chatheads). See this: How to create always-top fullscreen overlay activity in Android just be sure to make your view a small popup and not full screen, so the user will be able to answer the call.

Upvotes: 1

Related Questions