Android create shortcuts on the home screen

前端 未结 10 885
忘掉有多难
忘掉有多难 2020-11-22 13:16

What I want to do is:

1) I\'m inside an activity, there are 2 buttons. If I click the first one a shortcut is created in my home screen. The shortcut open an

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 13:29

    Since API level 26, using com.android.launcher.action.INSTALL_SHORTCUT is deprecated. The new way of creating shortcuts are using ShortcutManager.

    It mentions that there are 3 kinds of shortcuts, static, dynamic and pinned. Based on your requirements, you can choose to create them.

提交回复
热议问题