---
title: "Verify Android attachment picker cancellation"
description: "Check that cancelling an Android document selection leaves its parent form intact and that a later attachment uses the intended sandbox document."
canonical_url: "https://vostride.com/agent-library/android-flows/document-picker-cancel.md"
md_url: "https://vostride.com/agent-library/android-flows/document-picker-cancel.md"
content_kind: "recipe"
topic: "android-flows"
---

# Verify Android attachment picker cancellation

Check that cancelling an Android document selection leaves its parent form intact and that a later attachment uses the intended sandbox document.

## Risk

Opening a document provider can pause an activity and return an empty result. A broken implementation may erase the draft, attach stale content, or leave an invisible loading state that blocks the next selection.

## Fixtures

- An Android sandbox target with an explicit mobile app-state policy and a device already provisioned with two harmless fixture documents.
- A test issue account and a prepared draft title plus body that have not yet been saved.
- A project-owned attachment oracle exposing filename, byte length, and checksum without exposing document content or credentials.

## Steps

1. Enter the draft title and body, open Add attachment, and verify the documented document-selection surface appears.
2. Cancel selection through the available picker control and verify the app returns to the editor with the complete draft and no attachment badge.
3. Open Add attachment again, select the prepared small text document, and verify its exact filename appears once in the draft.
4. Save the issue and verify both the draft text and attachment filename appear on the persisted detail page after reopening it.
5. Inspect the independent attachment oracle and verify one attachment with the fixture checksum and byte length, then open the issue list and verify only one issue was created.

## Expected results

- Cancelling returns zero attachments and preserves both unsaved text fields.
- The committed attachment checksum matches the selected fixture rather than another provider document.
- The reopened issue contains one attachment relation and the original draft body.

## False-pass traps

- A filename alone can be reused for stale or empty content.
- An attachment badge left behind after cancellation can falsely imply a completed selection.

## Cleanup

- Delete the sandbox issue and its attachment, retaining the reusable device fixture documents.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa mobile testing](/docs/agent-qa/guides/mobile-testing.md)
- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa hooks](/docs/agent-qa/guides/hooks.md)

- [Android application QA recipes](/agent-library/android-flows.md)
- [Software factory QA library](/agent-library.md)
