{"id":23897943,"url":"https://github.com/byteszero/shortcutforandroid","last_synced_at":"2025-04-10T17:05:12.456Z","repository":{"id":30492469,"uuid":"34046612","full_name":"BytesZero/shortcutForAndroid","owner":"BytesZero","description":"shortcutForAndroid android创建快捷方式","archived":false,"fork":false,"pushed_at":"2015-04-17T02:19:57.000Z","size":240,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-24T14:46:15.160Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BytesZero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-16T09:26:52.000Z","updated_at":"2021-04-02T02:44:18.000Z","dependencies_parsed_at":"2022-08-17T18:10:14.169Z","dependency_job_id":null,"html_url":"https://github.com/BytesZero/shortcutForAndroid","commit_stats":null,"previous_names":["byteszero/shortcutforandroid"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FshortcutForAndroid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FshortcutForAndroid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FshortcutForAndroid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FshortcutForAndroid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BytesZero","download_url":"https://codeload.github.com/BytesZero/shortcutForAndroid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248260130,"owners_count":21074207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-04T17:19:14.765Z","updated_at":"2025-04-10T17:05:12.426Z","avatar_url":"https://github.com/BytesZero.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shortcutForAndroid\nshortcutForAndroid android创建快捷方式\n###主要代码如下\n```java\n/**\n * 创建快捷方式\n */\nprivate void createShortCut() {\n        // 创建快捷方式的Intent\n        Intent shortcutIntent = new Intent(\"com.android.launcher.action.INSTALL_SHORTCUT\");\n        // 不允许重复创建\n        shortcutIntent.putExtra(\"duplicate\", false);\n        // 快捷方式的名字\n        shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME,shortcut_name);\n        // 快捷方式icon\n        Parcelable icon = Intent.ShortcutIconResource.fromContext(\n                MainActivity.this, R.mipmap.shortcut);\n        //设置icon\n        shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon);\n        // 点击快捷图片，运行的程序主入口\n        Intent intent = new Intent(MainActivity.this,\n                MainActivity.class);\n\n        shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, intent);\n        // 发送广播,创建快捷方式\n        sendBroadcast(shortcutIntent);\n\n        Toast.makeText(MainActivity.this,\"快捷方式创建\",Toast.LENGTH_SHORT).show();\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteszero%2Fshortcutforandroid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyteszero%2Fshortcutforandroid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteszero%2Fshortcutforandroid/lists"}