Skip to content

Fix card/notes export as text and sharing#21000

Merged
BrayanDSO merged 2 commits intoankidroid:mainfrom
lukstbit:fix_exportTextShare
May 8, 2026
Merged

Fix card/notes export as text and sharing#21000
BrayanDSO merged 2 commits intoankidroid:mainfrom
lukstbit:fix_exportTextShare

Conversation

@lukstbit
Copy link
Copy Markdown
Member

@lukstbit lukstbit commented May 8, 2026

Purpose / Description

When sharing notes and card as a text file we created the share intent for an application/apkg which then failed. I passed a flag to distinguish between creating a share intent for an apkg or text file so the import succeeds.

Fixes

How Has This Been Tested?

Checked exporting everything and sharing back.

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Copy link
Copy Markdown
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Could do with a needsTest

supportFragmentManager.setFragmentResultListener(REQUEST_EXPORT_SHARE, this) { _, bundle ->
shareFile(
bundle.getString(KEY_EXPORT_PATH) ?: error("Missing required exportPath!"),
path = bundle.getString(KEY_EXPORT_PATH) ?: error("Missing required exportPath!"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requireString I believe

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge Queued for Cherry Pick to Stable Branch and removed Needs Review labels May 8, 2026
lukstbit added 2 commits May 8, 2026 17:33
Introduces a flag to distinguish between sharing a text file or an
apkg file after exporting.
Was returning Activity.intent, the only alternative path was incorrect
and would fail every time.
@lukstbit lukstbit force-pushed the fix_exportTextShare branch from cd2e88c to 54ce86a Compare May 8, 2026 14:33
@BrayanDSO BrayanDSO added this pull request to the merge queue May 8, 2026
@BrayanDSO BrayanDSO added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels May 8, 2026
Merged via the queue into ankidroid:main with commit ff8e408 May 8, 2026
19 checks passed
@github-actions github-actions Bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label May 8, 2026
@github-actions github-actions Bot added this to the 2.25 release milestone May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exporting txt from AnkiDroid to AnkiDroid shows the deck picker

3 participants