mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 07:46:55 +00:00
Don't crash when adding a shortcut.
Steps to reproduce: Menu > Add > Shortcut > Application > [any app] E/AndroidRuntime( 1734): Caused by: java.lang.ClassCastException: com.android.launcher2.ShortcutInfo E/AndroidRuntime( 1734): at com.android.launcher2.Workspace.onDropExternal(Workspace.java:963) E/AndroidRuntime( 1734): at com.android.launcher2.Workspace.addApplicationShortcut(Workspace.java:903) E/AndroidRuntime( 1734): at com.android.launcher2.Launcher.completeAddApplication(Launcher.java:669) E/AndroidRuntime( 1734): at com.android.launcher2.Launcher.onActivityResult(Launcher.java:371) E/AndroidRuntime( 1734): at android.app.Activity.dispatchActivityResult(Activity.java:3877) E/AndroidRuntime( 1734): at android.app.ActivityThread.deliverResults(ActivityThread.java:3340)
This commit is contained in:
@@ -963,7 +963,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
|
||||
switch (info.itemType) {
|
||||
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
|
||||
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
|
||||
if (info.container == NO_ID) {
|
||||
if (info.container == NO_ID && info instanceof ApplicationInfo) {
|
||||
// Came from all apps -- make a copy
|
||||
info = new ShortcutInfo((ApplicationInfo)info);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user