Moe Han
Moe Han

Reputation: 52

Android Shortcuts works with minimumSdkVersion lower than 25?

Does Android shortcuts work with the apps which have minSdkVersion lower than 25 ? Which compiledSdkVersion should be used to compile the project with shortcuts ?

According to Android Developer website, Launcher Shortcuts API is introduced in API 25.

Thanks !

Upvotes: 0

Views: 100

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 363825

The API was introduced with API 25.
To use them you have to use:

compileSdkVersion 25

or higher.

You can use a lower minSdkVersion, but of course it works only on Android 7.1 or higher and it's good practice to add the annotation @TargetApi(25) to the code to avoid compile errors and add a condition on the version before calling these methods.

if (Build.VERSION.SDK_INT >= 25) {
   // ShortcutManager...
}

Upvotes: 1

Related Questions