blob: 412e1add4c1bbb948b5a160a9d87aa9761fbb5ec [file] [log] [blame]
<html devsite="true">
<head>
<title>PositionalDataSource.LoadRangeCallback</title>
{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<h1>PositionalDataSource.LoadRangeCallback</h1>
{% setvar page_path %}androidx/paging/PositionalDataSource.LoadRangeCallback.html{% endsetvar %}
{% setvar can_switch %}1{% endsetvar %}
{% include "reference/_kotlin_switcher2.md" %}
<p>
<pre>abstract class PositionalDataSource.LoadRangeCallback</pre>
</p>
<hr>
<p>Callback for PositionalDataSource <code><a href="/reference/kotlin/androidx/paging/PositionalDataSource.html#loadRange(androidx.paging.PositionalDataSource.LoadRangeParams)">loadRange</a></code> to return data.</p>
<p>A callback should be called only once, and may throw if called again.</p>
<p>It is always valid for a <code><a href="/reference/kotlin/androidx/paging/DataSource.html">DataSource</a></code> loading method that takes a callback to stash the callback and call it later. This enables DataSources to be fully asynchronous, and to handle temporary, recoverable error states (such as a network error that can be retried).</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>T</code></td>
<td width="100%">
<p>Type of items being loaded.</p>
</td>
</tr>
</tbody>
</table>
</div>
<h2>Summary</h2>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2"><h3>Public constructors</h3></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div><code><a href="/reference/kotlin/androidx/paging/PositionalDataSource.LoadRangeCallback.html#LoadRangeCallback()">LoadRangeCallback</a>()</code></div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2"><h3>Public functions</h3></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>abstract <a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/paging/PositionalDataSource.LoadRangeCallback.html#onResult(kotlin.collections.List)">onResult</a>(data:&nbsp;<a href="/reference/kotlin/kotlin/collections/List.html">List</a>&lt;T&gt;)</code></div>
<p>Called to pass loaded data from <code><a href="/reference/kotlin/androidx/paging/PositionalDataSource.html#loadRange(androidx.paging.PositionalDataSource.LoadRangeParams)">loadRange</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<h2>Public constructors</h2>
<div><a name="LoadRangeCallback--"></a>
<h3 class="api-name" id="LoadRangeCallback()">LoadRangeCallback</h3>
<pre class="api-signature no-pretty-print"><a href="/reference/kotlin/androidx/paging/PositionalDataSource.LoadRangeCallback.html#LoadRangeCallback()">LoadRangeCallback</a>()</pre>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>T</code></td>
<td width="100%">
<p>Type of items being loaded.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h2>Public functions</h2>
<div><a name="onResult-kotlin.collections.List-"></a>
<h3 class="api-name" id="onResult(kotlin.collections.List)">onResult</h3>
<pre class="api-signature no-pretty-print">abstract&nbsp;fun&nbsp;<a href="/reference/kotlin/androidx/paging/PositionalDataSource.LoadRangeCallback.html#onResult(kotlin.collections.List)">onResult</a>(data:&nbsp;<a href="/reference/kotlin/kotlin/collections/List.html">List</a>&lt;T&gt;):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called to pass loaded data from <code><a href="/reference/kotlin/androidx/paging/PositionalDataSource.html#loadRange(androidx.paging.PositionalDataSource.LoadRangeParams)">loadRange</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>data</code></td>
<td width="100%">
<p>List of items loaded from the <code><a href="/reference/kotlin/androidx/paging/DataSource.html">DataSource</a></code>. Must be same size as requested, unless at end of list.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>