When you do startActivity()
with chooser, Android would list all apps entitled to handle your Intent
along with options to set this assignment perm
For a record - it was over-interpretation type of bug (of mine). The chooser I was using is exactly what can be seen on the image on the right side. And it was showing up all the time because... I was calling it all the time. I incorrectly assumed that chooser offers Always | Just once
functionality and would not show up if user tapped "Always" (and will show up if s/he used Just once
). But it is wrong. Chooser will always show up because that's its role - to let user choose.
The Always | Just once
functionality is different thing -> it is a feature of the Android framework for startActivity()
(and startActivityForResult()
etc) and it would show up automatically when needed (when there's more than one app, or precisely, more than one matching intent-filter
declared in app manifest, that matches certain Intent
). It would not show up if you got just one (or if user already choose Always
).
So you, as developer do not need to care nor handle the case in any special way. To fix the issue I simply changed my viewInExternalApplication()
code to just call startActivity()
:
try {
context.startActivity( intent );
} catch (.... )
and let the framework do the rest.