/**
* Create desktop shortcuts
*/
private void createShortcut() {
SharedPreferences setting = getSharedPreferences("", 0);
// Determine whether the application is started for the first time (default is true)
boolean firstStart = ("FIRST_START", true);
// Create desktop shortcuts on the first startup
if (firstStart) {
Intent shortcut = new Intent(".INSTALL_SHORTCUT");
// The name of the shortcut
(Intent.EXTRA_SHORTCUT_NAME, getString(.app_name2));
// Repeated creation is not allowed
("duplicate", false);
// Specify the startup object for the shortcut
ComponentName comp = new ComponentName((), "." + ());
(Intent.EXTRA_SHORTCUT_INTENT, new Intent(Intent.ACTION_MAIN).setComponent(comp));
// Shortcut icon
ShortcutIconResource iconRes = (this, );
(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconRes);
// Send a broadcast
sendBroadcast(shortcut);
// Set the first startup ID to false
Editor editor = ();
("FIRST_START", false);
// Submit settings
();
}
}