write code to create shortcut of the application on android device? yes COP 2660
ID: 3741262 • Letter: W
Question
write code to create shortcut of the application on android device? yes
COP 2660, Programming for Mobile Devices
Using Andriod Studio Create a working application where you can assess the implementation of shortcuts.
You can add other shortcut icons if you would prefer.
upload zipped file and screenshots
Purpose: The assignment is designed to assess the implementation of shortcut icons.
COP 2660, Programming for Mobile Devices Assignment 8 (25 points) 1. Create the working application as described in Chapter 8. For creative students: You can add other shortcut icons if you would prefer.Explanation / Answer
the below code helps you to access the shortcut
Intent shortcutIntent = new Intent(); shortcutIntent.setClassName("WRITE YOUR PACKAGE NAME", "WRITE HERE YOUR CLASS NAME"); Intent addIntent = new Intent(); addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent); addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "WRITE HERE YOUR SHORTCUT NAME"); addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(context, R.drawable.icon)); addIntent.setAction("com.android.launcher.action.INSTALL_SHORTCUT"); context.sendBroadcast(addIntent);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.