简体   繁体   中英

Android launcher - browser link redirect shortcut

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);

Reference

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM