Skip to content

Fix Crash on Missing Downloads App#93

Merged
smashedr merged 1 commit intomasterfrom
fix
Feb 21, 2026
Merged

Fix Crash on Missing Downloads App#93
smashedr merged 1 commit intomasterfrom
fix

Conversation

@smashedr
Copy link
Member

@smashedr smashedr commented Feb 21, 2026

This line: startActivity(Intent(DownloadManager.ACTION_VIEW_DOWNLOADS))
Caused a crash if the system does not have an app installed to handle the ACTION_VIEW_DOWNLOADS, in other words a downloads app.

To fix this I wrapped it in a try/catch:

try {
    startActivity(Intent(DownloadManager.ACTION_VIEW_DOWNLOADS))
} catch (e: ActivityNotFoundException) {
    Log.e("downloadManager", "No activity found to handle ACTION_VIEW_DOWNLOADS", e)
    Toast.makeText(requireContext(), "Downloads App Unavailable!", Toast.LENGTH_LONG)
        .show()
}

@smashedr smashedr merged commit 2180d1d into master Feb 21, 2026
1 check passed
@smashedr smashedr deleted the fix branch February 21, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant