How Should Your App Load Long Lists Without Freezing?
Your app should fetch long lists in manageable pages and render only the rows around the user's current position. Pagination controls how much data arrives; a virtualised list controls how much of it becomes visible interface elements. Combine these with image caching, predictable ordering and position recovery, then test the whole journey on representative phones. Android's Paging library overview describes the loading side of this.
Why separate loading records from rendering rows?
Think of a product catalogue. Fetching every product before showing the first screen makes the user wait for content they may never reach. Creating a row for every downloaded product also gives the phone unnecessary work.
Treat these as separate decisions:
| Layer | What to specify |
|---|---|
| Data loading | Fetch a bounded page of records |
| Row rendering | Keep a window around the visible position |
| Images | Request suitable sizes and reuse cached copies |
| Navigation | Restore the record and position the user left |
| Refresh | Define how new, changed and removed records appear |
Include these behaviours in your app MVP scope. “Show the catalogue” leaves too much undecided when the catalogue grows.
How should pagination work?
Pagination divides a result set into smaller responses. For a continuously scrolling list, request another page as the user approaches the end of the content already loaded. Keep existing rows visible while that request runs.
Specify four distinct states: loading the first page, loading another page, failing to load another page, and reaching the end. A failed request should offer a retry beside the existing content. It should not replace the whole list with an error.
Two common approaches are offset and cursor pagination. Offset pagination asks for records after a numbered position. Cursor pagination asks for records after a marker returned with the previous page. When records are inserted or removed, numbered positions can shift; cursor behaviour depends on the ordering and consistency rules behind it.
For a changing feed, ask whether the service supports a cursor tied to a deterministic order. If users need numbered pages or direct jumps, discuss that requirement before choosing the approach.
Allow only one active request for the same next page. If the user changes a filter while a request is running, prevent its old response from entering the new results.
What does a virtualised list need to handle?
A virtualised list maintains a rendering window around the visible rows instead of creating every loaded row at once. The exact behaviour depends on the list component and its configuration. Android's RecyclerView guide and React Native's FlatList optimisation notes describe two such components.
Ask the development team to use the framework's supported list component and test it with the actual row design.
Keep each record's identity separate from its position. Selection, saved status and other meaningful state should belong to the record's stable ID. Moving a record should not transfer its state to its new neighbour.
Make loading placeholders resemble the final row dimensions. Specify image space before an image arrives, and test rows with long titles or expanded details. The acceptance condition is simple: loading content must not unexpectedly move the item someone is reading or tapping.
How should images load and stay cached?
Request an image sized for its display area. Use a thumbnail in a list and request a larger version when the detail screen needs it.
Image caching can reuse a previously retrieved image, subject to the cache policy, storage limits and whether that copy remains available. It cannot guarantee that an image will always be present offline.
Set these expectations:
- Show a placeholder while an image loads.
- Keep text and actions usable if the image fails.
- Reserve the image's display space.
- Define how changed images receive a new version or invalidate an older copy.
- Limit advance loading to a nearby window.
Treat private images separately. Decide what must be cleared on sign-out or an account change. Do not promise offline access unless it is an explicit feature with its own storage and testing requirements.
How do stable ordering and duplicate records fit together?
Write down the complete sort rule. “Newest first” needs a tie-breaker when records share the same timestamp. A unique record ID can provide that tie-breaker, provided the service applies the same rule to every page.
A deterministic order resolves ties. It does not freeze a changing collection. If records can move during browsing, decide whether the user sees a stable browsing snapshot or live changes.
Merge incoming pages by stable record ID. If a record appears again, reconcile it with the existing record instead of appending another row.
Duplicate removal alone cannot recover a record skipped between requests. Test insertions, deletions and sort changes across page boundaries. The loading contract must address missing records as well as repeated ones.
How should refresh preserve the user's position?
Define refresh behaviour according to the user's action.
An explicit pull-to-refresh may intentionally show the newest content at the top. Returning from a detail screen should usually restore the previous place. A background update should avoid moving the row someone is reading.
Use a record ID as the position anchor, together with its offset within the visible area. A row number alone is fragile when records are inserted above it.
Define fallbacks too. If the anchor record disappears, restore the nearest surviving neighbour where possible. If a filter or sort changes, start at the beginning of that new result set. If recovery fails, offer a clear route back into the list.
For example, consider an illustrative catalogue with 2,000 products, fetched in pages of 40. A shopper opens a product halfway through browsing. On return, the acceptance condition is that the same product remains near the same screen position, even if earlier products have changed.
What should you test before release?
Use a dataset that represents the intended catalogue, feed or history. Include image-heavy rows, long text and records with identical sort values.
Your Android app testing checklist should include these list-specific checks:
- Scroll quickly while another page loads.
- Lose connectivity during a request, then retry.
- Change filters before the previous response arrives.
- Receive overlapping pages and confirm one row per ID.
- Add or remove records between page requests.
- Open a detail screen and return to the same place.
- Refresh while positioned far down the list.
- Test empty results, the final page and failed images.
- Change accounts and check that previous results disappear.
Agree on the target devices, dataset and acceptable behaviour before sign-off. Repeat the relevant checks during maintenance after launch.
What common mistakes should you avoid?
Do not treat a spinner as the whole loading design. Specify what remains usable, how retry works and where the user continues.
Do not add pagination while allowing loaded rows and images to accumulate without a memory policy. Do not add virtualisation while still fetching the entire collection at startup. These controls serve different purposes.
Also avoid silently reordering rows during interaction, identifying records by their current index, or resetting the screen after every refresh.
For a small, strictly bounded list, pagination may add unnecessary complexity. Choose it because the expected data and measured behaviour justify it.
What do founders often ask about long lists?
Is infinite scrolling required?
No. A “Load more” button or numbered pages may fit the task better. Choose based on whether people browse continuously, compare results or need to return to a particular page.
Is there one correct page size?
No universal size belongs in the product brief. Start with a bounded choice, then evaluate it using representative rows, images, connections and devices.
Does caching replace pagination?
No. Give each a separate acceptance condition: pagination controls requests for more records; caching defines when previously retrieved content can be reused.
Can the app always restore the exact position?
Do not promise exact restoration after records disappear or the result set changes. Specify restoration to the same record when available, plus a useful fallback when it is gone.