Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Shikha_Pandey
Posts: 37
Registered: ‎07-13-2014
My Device: Z10
My Carrier: Vodafone

Contacts Listing issue in Q10

Hi All,

 

I have used ContactService api to retrieve blackberry phone contacts. The problem which is occuring is that phone has in total 400 contacts but when i retrieve the contacts using contact service api only 22 are displayed everytime on gui of application.

 

Device being used for testing is blackberry q10. The code snippet is as below:-

 

 QList<Contact> contacts;
 ContactListFilters filter;
 contacts = m_contactService->contacts(filter);

 

This QList<Contact> retrieved is used for displayed on gui screen.

 

This list has only 22 contacts instead of 400 everytime i run this application.

 

Please suggest.

 

Thanks & Regards

Please use plain text.
Developer
BBSJdev
Posts: 6,089
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Contacts Listing issue in Q10

The query has a default limit (25 if I remember correctly) per call and misses out certain accounts.

 

A quick search in these forums will give more complete answers.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
New Developer
Shikha_Pandey
Posts: 37
Registered: ‎07-13-2014
My Device: Z10
My Carrier: Vodafone

Re: Contacts Listing issue in Q10

Thanks for replying well i searched in forums and found that yes in default it shows only some of the contacts we need to change the filter by calling the method 

filter.setLimit(50);

 

Here the value set as argument will decide number of contacts displayed.

 

But there is a doubt .  As stated in below thread:-

 

http://supportforums.blackberry.com/t5/Native-Development/ContactService-can-not-get-full-contacts-f...

 

setLimit with argument as 0 displays all the contacts, does this really works or is it a bug.  Please clarify some more on this, because as stated in thread it says that app crashes after setLimit was given argument as 0

 

Thanks & Regards

Please use plain text.