if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1) {
Intent shortcutIntent = new Intent(getApplicationContext(), SplashScreen.class);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
shortcutIntent.setAction(Intent.ACTION_MAIN);
ShortcutInfoCompat shortcut = new ShortcutInfoCompat.Builder(getApplicationContext(), "shortcut")
.setShortLabel(getResources().getString(R.string.app_name))
.setIcon(IconCompat.createWithResource(getApplicationContext(), R.mipmap.apt_launcher))
.setIntent(shortcutIntent)
.build();
ShortcutManagerCompat.requestPinShortcut(getApplicationContext(), shortcut, null);
}