October 2018
Intermediate to advanced
464 pages
15h 17m
English
For an app to create a shortcut, it must have the INSTALL_SHORTCUT permission. With the appropriate permission, it's a simple matter of calling an intent with your app properties. The following are the steps:
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Create Shortcut" android:onClick="createShortcut" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf= ...