Introduction: IntentUtils is a small wrapper for handling app selection on intent opening.
More: Author   ReportBugs   

AndroidStudio 3.1.4 minSDK 16 targetSDK 27

IntentUtils is a small wrapper for handling intent opening via startActitvy.

It handles incoming intents the following way:

  1. If there is only one App that can handle the Intent it is open directly
  2. If there are multiple apps for hanlding the intent, the chooser is shown
  3. If there is no app that could handle the intent, a Dialog is open and shows a hint


Add jitpack to your repositories in Project build.gradle :

allprojects {
    repositories {
        maven { url "" }

Add dependency to your app build.gradle :

implementation 'com.github.grumpyshoe:android-module-intentutils:1.0.0'


This library contains a extension function for handling intent opening :

/* kotlin */

// example intent for open a email app
val i = Intent(Intent.ACTION_SEND)
i.type = "message/rfc822"
i.putExtra(Intent.EXTRA_EMAIL, arrayOf(""))
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email")
i.putExtra(Intent.EXTRA_TEXT, "body of email")
/* java */

// example intent for open a email app
Intent i = new Intent(Intent.ACTION_SEND);
i.putExtra(Intent.EXTRA_EMAIL, new String[]{""});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
i.putExtra(Intent.EXTRA_TEXT, "body of email");, this, null);


Multiple Apps available

If there are multiple app that are able to handle the intent request, the chooser will be shown. For customize the title of that chooser override the string value app_chooser_dialog_title with the corresponding text. The default for this value is: "Choose an app".

No App available

If no apps can be found that could handle this intent a ÀlertDialog is shown. This dialog contains a title (default value: "Hint"),a message (default value: "There are no apps that could handle this content.") and a button (default label "OK").

To set a custom title and message there are two ways:

  1. Override the string value no_app_for_intent_dialog_title, no_app_for_intent_dialog_message and no_app_for_intent_dialog_btn_ok_text with the corresponding text.

  2. You can add a instance of NoAppAvailable and define your customized texts there (for all or just for some fields):

    /* kotlin */
    // all fields, NoAppAvailable("Custom Title Text", "Custom Message Text", "Custom Button Text"))
    // or just the fields you wnat to change, NoAppAvailable(message ="Custom Message Text"))
    /* java */
    // all fields, this, new NoAppAvailable("Custom Title Text", "Custom Message Text", "Custom Button Text"))
    // or just the fields you wnat to change, this, new NoAppAvailable(null, "Custom Message Text", null));

Need Help or something missing?

Please submit an issue on GitHub.


This project is licensed under the terms of the MIT license. See the LICENSE file.

Build Environment

Android Studio 3.1.4
Build #AI-173.4907809, built on July 23, 2018
JRE: 1.8.0_152-release-1024-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.13.4
Support Me
About Me
Google+: Trinea trinea
GitHub: Trinea