Android:启动快捷方式选择器
我到处寻找与此相关的东西。我想根据设备上安装的快捷方式启动快捷方式。
一种简单的方法是我的用户通过我的应用程序选择他的快捷方式之一。当用户通过我的应用程序启动快捷方式时,它将执行与他/她在主屏幕上并选择快捷方式完全相同的操作。
我可以使用系统快捷方式单独执行此操作,但我希望设备上安装的其他快捷方式具有更大的灵活性。
所以基本上,我需要弄清楚如何调出快捷方式选择器(通过长按主屏幕并选择快捷方式出现的相同列表),获得启动该快捷方式的意图并将其存储在我的应用程序数据中以供以后使用。我不想在用户选择快捷方式时实际启动它,我只是想记住它以供以后使用。
任何有关这方面的帮助将不胜感激:)
I have looked everywhere for something related to this. I want to launch a shortcut, based on the shortcuts installed on a device.
A simple way of putting this is my user selects one of his shortcuts through my application. When the user initiates the shortcut through my app, it will perform the exact same thing as if he/she is on the home screen and selects the shortcut.
I can do this individually with the system shortcuts, but I want to have more flexibility for other shortcuts installed on the device.
So basically, I need to figure out how to bring up the shortcut picker (the same list that appears by long pressing a home screen and selecting shortcuts), get the intent to launch that shortcut and store that within my application data for use later. I don't want to actually initiate the shortcut when the user selects it, I just want to remember it for later.
Any help with this would be greatly appreciated :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想你正在寻找这个: https://developer.android.com /reference/android/content/Intent.html#ACTION_CREATE_SHORTCUT
I think you are looking for this: https://developer.android.com/reference/android/content/Intent.html#ACTION_CREATE_SHORTCUT