Affiliate links on Android Authority may earn us a commission.Learn more.
Implementing Android Nougat and Oreo’s static, dynamic and pinned shortcuts
July 20, 2025
Android users can create shortcuts to any of their applications. It’s a quick and easy process that just involves placing the app’s launcher icon onto the homescreen.
While this kind of shortcut does make it easier to open apps, launcher icons do have one major limitation: they can only launch an app’s starting screen. If you’ve created a calendar app, then regardless of whether you want to review today’s schedule, add a new event, or edit an existing event, you’ll have to first enter the app at exactly the same location every time. From there, you’ll have to navigate to the appropriate Activity.

The fewer screens the user has to navigate to complete a task, the better the user experience, but this is difficult to deliver when every task has exactly the same starting point.
With the release ofOreoandNougat, you may now use dynamic, static, and pinned shortcuts to create entirely different entry points for different tasks. That means making any app Activity accessible from the your homescreen and app drawer.

In this article, I’m going to show you how to implement these new shortcuts in your Android projects. We’ll create a static shortcut, a dynamic shortcut that changes at runtime based on user action, and a pinned shortcut that performs an action outside of your application.
What are the new Nougat and Oreo shortcuts?
Android 7.1 introduced static and dynamic shortcuts, which the user can access by long-pressing an app’s launcher icon, either on the homescreen or in the application drawer.
Static shortcuts are defined inside an XML resource file, so they can’t be changed at runtime or modified to suit the individual user. If you want to update a static shortcut, then you’ll need to release a new version of your app. Static shortcuts tend to work best for generic actions that remain constant across your application’s lifetime, for example launching an Activity where the user can create a new email.

Dynamic shortcuts are more flexible, and can be published, updated, and deleted at runtime, so you can modify dynamic shortcuts based on user behavior or preferences, or in response to factors such as their current location or time of day. Shortcuts that link to a specific document, contact, or file on the user’s device are all good candidates for dynamic shortcuts.
Your app can publish a maximum of five static and dynamic shortcuts.

Android 8.0’s Pinned Shortcuts
Introduced in Android Oreo, pinned shortcuts are shortcuts that the user can create at runtime, via a dialog.
Applications typically trigger this dialog in response to user action, such as selecting “pin the current screen” from the app’s menu.

If you have an Android device or AVD (Android Virtual Device) that’s running 8.0 or higher, then the Chrome application provides a good example of how you might use pinned shortcuts:
Creating an Android 7.1 static shortcut
We’re going to start by adding a static and a dynamic shortcut to an Android application, so create a new project using the “Empty Activity” template.
While you could create a static shortcut that points to MainActivity, application shortcuts are designed to provide easy access to Activities that aren’t the starting Activity, so we’re going to create a second Activity that this static shortcut can link to.
I’m using a simple Activity that features a “Send Email” button. When tapped, this button will fire an intent that launches the device’s default email application.
Create a shortcuts.xml file
You define static shortcuts inside their own XML file, which contains all the characteristics for that shortcut, such as its icon and label, but also the intent that’ll launch whenever the user selects that shortcut.
Drawables and strings
Next, you’ll need to define the drawable and string resources that are used in this shortcut:
Next, you’ll need to create the short label, and the long label that’ll be displayed whenever there’s enough onscreen space.
Add shortcuts.xml to your Manifest
Finally, you need to add the shortcuts.xml file to your project’s Manifest. You must add shortcuts.xml to the Activity that has the android.intent.action.MAIN and android.intent.category.LAUNCHER intent filters, which is typically MainActivity.
Test your static shortcut
To put this static shortcut to the test, install your project on a physical Android device or an AVD running Android 7.1 or higher.
You can access static shortcuts from your application’s launcher icon as it appears in the app drawer, or by adding the launcher icon to your homescreen (as I’ve done in the following screenshot). Long-press your app’s launcher, and a popup will appear containing the static shortcut.
Tap this shortcut, and it should launch the EmailActivity.
Creating customizable dynamic shortcuts
Next, let’s add a simple dynamic shortcut to our project and look at how we can update this shortcut at runtime.
You create a dynamic shortcut by generating a ShortcutInfo object that defines all the shortcut’s characteristics, such as its short label and icon and the intent you want to trigger with the shortcut.
Updating the shortcut at runtime
This is all you need to create a functioning dynamic shortcut, but the biggest advantage of dynamic shortcuts is their ability to update at runtime — something our shortcut doesn’t currently do.
Let’s add a button to activity_main.xml that, when tapped, changes the shortcut’s label:
To update a shortcut, you need to call the updateShortcuts() method and pass the ID of the shortcut you want to update:
To test your dynamic shortcut:
You candownload this project from GitHub.
Pinned shortcuts
In Android Oreo and higher, users can pin shortcuts to supported launchers.
Unlike dynamic and static shortcuts, pinned shortcuts are displayed as separate icons and the user must complete a dialog in order to add them to their launcher. There’s also no limit to the number of pinned shortcuts that your application can offer.
As we’ve seen, application shortcuts reference intents, so even though we’ve focused on launching Activities, you can create a shortcut for any action that can be expressed as an intent, including actions that occur outside of your application’s Activities. For example, if your app has an online user manual then you might create a shortcut that, when tapped, loads this section of your website in the device’s default browser.
To demonstrate this, we’re going to create a pinned shortcut that loads a URL in the device’s browser.
By default, your app’s broadcast receiver isn’t notified when the user pins a shortcut successfully. If your app does need to be notified, then you’ll have to create an intent, as I’ve done in the above example.
Next, you’ll need to create the “launch_url” icon:
To test your pinned shortcut:
Don’t break your app’s navigation!
Instead of using a shortcut to launch a single Activity, you may want to consider launching multiple Activities. The user will still only see a single Activity (the last Activity in the list) but when they press their device’s “Back” button they’ll return to the previous Activity in the list. If your shortcut launches a single Activity, then pressing the “Back” button will immediately take the user out of the application, which may not be the experience they want.
By launching multiple Activities, you can recreate your app’s usual navigation, so that pressing “Back” takes the user to the previous screen in the app.
For static shortcuts, you define multiple intents in your project’s xml/shortcuts.xml file:
Tapping the static shortcut will still launch EmailActivity, but when the user taps their device’s “Back” button they’ll be taken to MainActivity, rather than exiting the app.
you’re able to assign multiple Activities to a dynamic shortcut, using setIntents() instead of setIntent():
Don’t recycle shortcuts
Application shortcuts often have a shelf life. Perhaps the user deletes the content a shortcut was originally pointing towards, or they remove a feature from the application, which makes one or more shortcuts redundant.
While you might be tempted to recycle a pinned shortcut, changing the action associated with a shortcut is a great way to get confused!
If a pinned or dynamic shortcut is no longer useful, then you may disable it by calling disableShortcuts() and then passing the ID of the shortcut(s) you want to disable.
To remove a static shortcut from your project, you’ll need to issue a new version of your app.
Using Auto backup?
TheAuto Backup feature, introduced in Android 6.0, can save up to 24 MB of your app’s data to your Google Drive account. This data can then be restored if you ever reinstall your app, for example following a factory reset or if you switch to a new device.
Auto Backup is enabled by default, so unless you’ve added android:allowBackup=”false” to the Manifest, your project is using Auto Backup.
If your app’s data is restored from one of these backups, then its static shortcuts and pinned shortcuts are restored automatically, but dynamic shortcuts aren’t restored. If you do use dynamic shortcuts, then you should check whether your app has been restored, and then re-publish its dynamic shortcuts if necessary:
Wrapping up
What do you think about Android Nougat and Oreo’s new shortcuts? Do you plan to use them in your projects? Or are you happy with the traditional launcher icon approach? Let us know in the comments below!
Thank you for being part of our community. Read ourComment Policybefore posting.