diff --git a/apidoc/Titanium/UI/ShortcutItem.yml b/apidoc/Titanium/UI/ShortcutItem.yml index 0ca23115358..12d4f9601c9 100644 --- a/apidoc/Titanium/UI/ShortcutItem.yml +++ b/apidoc/Titanium/UI/ShortcutItem.yml @@ -8,7 +8,54 @@ description: | Use the method to create a shortcut item and pass it to the method to add it to the application. - #### iOS static shortcuts + #### Android Static Shortcuts + Google documents how to add static shortcuts + [here](https://developer.android.com/guide/topics/ui/shortcuts/creating-shortcuts#static). + + In the `tiapp.xml` file, you will need to add a shortcuts `` element to your main activity. + ``` xml + + + + + + + + + + + + + + + + ``` + + You will also need to create a `shortcuts.xml` file as shown below, defining all of the app's static shortcuts. + This file must reside in the Titanium project's `./platform/android/res/xml` folder. Note that XML attributes + `icon`, `shortcutShortLabel`, `shortcutLongLabel`, and `shortcutDisabledMessage` must be defined as string + resources under the project's `i18n` folders or `./platform/android/res/values` folders. + Attributes `targetPackage` and `targetClass` need to be set to your project id and app name. + ``` xml + + + + + + + + ``` + + #### iOS Static Shortcuts Static shortcut items can be set in the `` section of the `tiapp.xml` before launching the app. Here is an example how to create static application shortcuts in the `tiapp.xml`: