OneDrive / onedrive-sdk-android

OneDrive SDK for Android!
https://dev.onedrive.com
Other
148 stars 52 forks source link

Next page is never delivered for item collection #89

Closed hschottm closed 8 years ago

hschottm commented 8 years ago

Using the example to get the next page when you list items doesn't work with the actual version of the API. The example

final String itemId = "0000000000000000000000";
final ICallback<IItemCollectionPage> callback = new ICallback<IItemCollectionPage> {
    @Override
    public void success(final IItemCollectionPage result) {
        // If there was more pages retrieve them too
        if (result.getNextPage() != null) {
            result.getNextPage()
                  .buildRequest()
                  .get(new ICallback<IItemCollectionPage> ...);
        }
        Toast.makeText(getActivity(), "Got children", Toast.LENGTH_LONG).show();
    }
    ...
    // Handle failure
}

oneDriveClient
    .getDrive()
    .getItems(itemId)
    .getChildren()
    .buildRequest()
    .get(callback);

always lists the first 200 items and you going to end up in an endless loop. I tested this with a directory with 399 items. The result.getNextPage().buildRequest().get() function always delivered the first 200 items.

This did once work with an earlier version of the API (last time I checked was in February)