I want to add an Android launcher shortcut to open a link with it. Something like this images This is possible? And if is possible, how can I make it?
[
An example of creating a dynamic shortcut and associating it with your app appears in the following code snippet:
ShortcutInfo shortcut = new ShortcutInfoCompat.Builder(context, "id1")
.setShortLabel("Website")
.setLongLabel("Open the website")
.setIcon(Icon.createWithResource(context, R.drawable.icon_website))
.setIntent(new Intent(Intent.ACTION_VIEW,
Uri.parse("https://www.mysite.example.com/")))
.build();
ShortcutManagerCompat.pushDynamicShortcut(context, shortcut);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.