- try {
- createHomeScreenShortcutListener = (CreateHomeScreenShortcutListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement CreateHomeScreenShortcutListener.");
- }
+
+ // Get a handle for `CreateHomeScreenShortcutListener` from the launching context.
+ createHomeScreenShortcutListener = (CreateHomeScreenShortcutListener) context;