Fix crash when dragging from all apps to home.

This commit is contained in:
Patrick Dubroy
2010-10-25 14:24:36 -07:00
parent 960c6f4bcf
commit 3c6dbcdcfe
@@ -481,15 +481,18 @@ public class AllAppsPagedView extends PagedView
@Override
public void onDestroyActionMode(ActionMode mode) {
final Menu menu = mode.getMenu();
// Re-parent the drop targets into the toolbar, and restore their layout params
ApplicationInfoDropTarget infoButton =
(ApplicationInfoDropTarget) mLauncher.findViewById(R.id.info_button);
(ApplicationInfoDropTarget) menu.findItem(MENU_APP_INFO).getActionView();
((ViewGroup) infoButton.getParent()).removeView(infoButton);
mOrigInfoButtonParent.addView(infoButton, mOrigInfoButtonLayoutParams);
infoButton.setVisibility(View.GONE);
infoButton.setManageVisibility(true);
DeleteZone deleteZone = (DeleteZone) mLauncher.findViewById(R.id.delete_zone);
DeleteZone deleteZone = (DeleteZone) menu.findItem(MENU_DELETE_APP).getActionView();
((ViewGroup) deleteZone.getParent()).removeView(deleteZone);
mOrigDeleteZoneParent.addView(deleteZone, mOrigDeleteZoneLayoutParams);
deleteZone.setVisibility(View.GONE);