Android App create desktop shortcut code

The shortcut of Android is relatively simple, that is, send a system broadcast, and then set intent for the shortcut---

AppXiKange. Getapp() is to get the activity object.

Note that you want to set permissions in the manifest file

In this way, when you want to add a shortcut, you can give the user an alert dialog, prompt, and then reference. That's it.

There are also many applications in the market that create shortcuts directly during application installation. However, this implementation is not very friendly. Not recommended.

The following complete code demonstration uses a slightly different method from the above:

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>