Skip to content

Use Intent.createChooser() instead of directly calling startActivity() with the Intent #4

Description

@cketti

Calling startActivity() on the intent will only show a chooser dialog when there's more than one app capable of receiving the intent. Then the user will also be able to select one of these apps as default app. When sharing content this is usually not the desired behavior.

Using [Intent.createChooser()](https://developer.android.com/reference/android/content/Intent.html#createChooser%28android.content.Intent, java.lang.CharSequence%29) will always display a chooser dialog and not allow the user to select a default application.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions