Android programming method for adding shortcut to desktop

This article describes the method of adding shortcuts to the desktop by Android programming. Share with you for your reference, as follows:

Sometimes shortcuts need to be added to the desktop for ease of use. The following are two ways to add shortcuts:

Method 1:

The shortcut added through the above code can only be added in the program startup, not in the event. Now I don't want to understand what it is, and I haven't studied it carefully. I want to know my friends to inform me! In addition, it is not directly added to the desktop, but added to the add shortcut window, as shown in the figure:

Method 2:

Of which:

Indicates that duplicate settings are not allowed

This code is directly added to the desktop and also displayed in the place shown above, but the following permissions need to be added:

PS: for more information about Android manifest permission control, please refer to our online tools:

Description of Android manifest functions and permissions: http://tools.jb51.net/table/AndroidManifest

For more Android related content, readers who are interested can view the topics on this site: introduction and advanced tutorial of Android development, summary of Android debugging skills and common problem solutions, summary of Android multimedia operation skills (audio, video, recording, etc.), summary of Android basic component usage, summary of Android view skills Android layout skills summary and Android control usage summary

I hope this article will help you in Android programming.

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
分享
二维码
< <上一篇
下一篇>>