Skip to content
Advertisement

ACTION_MANAGE_UNKNOWN_APP_SOURCES: startActivityForResult() or startActivity()?

I’m following these tree examples where is showed how request permission to install an app from an unknown source:

  1. How to manage installation from Unknown Sources in Android Oreo?
  2. How to use PackageManager canRequestPackageInstalls in Android Oreo?
  3. Android 8 unknown source app installation

When i tested with startActivityForResult(), onActivityResult() never was called when i enable or disable (on switch widget).

Then my doubt is: startActvity() or startActivityForResult()? if startActivityForResult(), show me how this can works correctly please.

Advertisement

Answer

The documentation for ACTION_MANAGE_UNKNOWN_APP_SOURCES says: “Output: nothing”. Hence, use startActivity(), not startActivityForResult().

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement