List of usage examples for com.google.gwt.gdata.client.contacts ContactQuery setMaxResults
public final native void setMaxResults(double maxResults) ;
From source file:com.google.gwt.gdata.sample.hellogdata.client.ContactsRetrieveContactsDemo.java
License:Apache License
/** * Retrieves a contacts feed using a Query object. * In GData, feed URIs can contain query string parameters. The * GData query objects aid in building parameterized feed URIs. * Upon successfully receiving the contacts feed, the contact entries * are displayed to the user via the showData method. * The MaxResults parameter is used to limit the number of entries * returned./*from w ww . j a v a 2s . c o m*/ * * @param contactsFeedUri The contacts feed uri. */ private void queryContacts(String contactsFeedUri) { showStatus("Loading contacts feed...", false); ContactQuery query = ContactQuery.newInstance(contactsFeedUri); query.setMaxResults(50); service.getContactFeed(query, new ContactFeedCallback() { public void onFailure(CallErrorException caught) { showStatus("An error occurred while retrieving the Contacts feed: " + caught.getMessage(), true); } public void onSuccess(ContactFeed result) { ContactEntry[] entries = result.getEntries(); if (entries.length == 0) { showStatus("You have no Contacts.", false); } else { showData(entries); } } }); }