ShutCut Menu
In order to Show ShutCut Menu When App Icon Long Pressed in your Sketchware project, use the codes provided below. Step 1 :- Take A Add Source Directly Block And Put The Following Code In It. android.content.pm.ShortcutManager shortcutManager = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { shortcutManager = getSystemService(android.content.pm.ShortcutManager.class); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (shortcutManager != null) { This Code Will Give Promisson For Creating ShutCut Menu. Step 2 :- Again Take A Add Source Directly Block And Put The Following Code In It. android.content.pm.ShortcutInfo shutcut1 = new android.content.pm.ShortcutInfo.Builder(MainActivity.this, " Home" ) .setShortLabel(" Home ") .setLongLabel(" Home ") .setRank( 0 ) .setIntent(new android.content.Intent(android.content.Intent.ACTION_VIEW, null, MainActivity .this, MainActivity.class)...

Comments
Post a Comment