# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Methods | Inherited Methods

# SearchResults

`public class SearchResults`
`extends Object` `implements Closeable`

java.lang.Object
↳ | android.app.appsearch.SearchResults

Encapsulates results of a search operation.

Each `AppSearchSession#search` operation returns a list of `SearchResult` objects, referred to as a "page", limited by the size configured by `SearchSpec.Builder.setResultCountPerPage(int)`.

To fetch a page of results, call `getNextPage(Executor, Consumer>>)`.

All instances of `SearchResults` must call `SearchResults#close()` after the results are fetched.

This class is not thread safe.

## Summary

### Public methods
`void` | `close()` Closes this stream and releases any system resources associated with it.
`void` | `getNextPage(Executor executor, Consumer<AppSearchResult<List<SearchResult>>> callback)` Retrieves the next page of `SearchResult` objects.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.
From interface `java.io.Closeable`
`abstract void` | `close()` Closes this stream and releases any system resources associated with it.
From interface `java.lang.AutoCloseable`
`abstract void` | `close()` Closes this resource, relinquishing any underlying resources.

## Public methods

### close

    public void close ()

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in `AutoCloseable#close()`, cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the `Closeable` as closed, prior to throwing the `IOException`.

### getNextPage

    public void getNextPage (Executor executor,
                    Consumer<AppSearchResult<List<SearchResult>>> callback)

Retrieves the next page of `SearchResult` objects.

The page size is configured by `SearchSpec.Builder#setResultCountPerPage`.

Continue calling this method to access results until it returns an empty list, signifying there are no more results.

Parameters
`executor` | `Executor`: Executor on which to invoke the callback. This value cannot be `null`. Callback and listener events are dispatched through this `Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `Context.getMainExecutor()`. To dispatch events through a shared thread pool, you can use `AsyncTask#THREAD_POOL_EXECUTOR`.
`callback` | `Consumer`: Callback to receive the pending result of performing this operation. This value cannot be `null`.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*