Ath*_*ira 5 android android-shortcut pinned-shortcut
如何在Android中的应用程序快捷方式图标中删除徽章?当我以编程方式创建应用程序快捷方式时,连同为快捷方式指定的图标一样,应用程序图标位于图标的右下角。我不要那个徽章
这是我使用的代码
public static void addShortcutToHomeScreen(Context context)
{
if (ShortcutManagerCompat.isRequestPinShortcutSupported(context))
{
ShortcutInfoCompat shortcutInfo = new ShortcutInfoCompat.Builder(context, "#1")
.setIntent(new Intent(context, Splash.class).setAction(Intent.ACTION_MAIN)) // !!! intent's action must be set on oreo
.setShortLabel("Test")
.setIcon(IconCompat.createWithResource(context, R.drawable.logo))
.build();
ShortcutManagerCompat.requestPinShortcut(context, shortcutInfo, null);
}
else
{
// Shortcut is not supported by your launcher
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1706 次 |
| 最近记录: |