Fix bug 2185026 - back button in context menu now calls onContextMenuClosed()

Change-Id: I6c16879a8ad8e4651d21f639a620a936bf991f8d
This commit is contained in:
Adam Powell
2010-04-02 16:05:20 -07:00
parent eb6e3edc0f
commit 6024ca5c90

View File

@@ -101,11 +101,19 @@ public class MenuDialogHelper implements DialogInterface.OnKeyListener, DialogIn
}
}
}
} else if (event.getAction() == KeyEvent.ACTION_UP
&& event.isTracking() && !event.isCanceled()) {
mMenu.close(true);
dialog.dismiss();
return true;
} else if (event.getAction() == KeyEvent.ACTION_UP && !event.isCanceled()) {
Window win = mDialog.getWindow();
if (win != null) {
View decor = win.getDecorView();
if (decor != null) {
KeyEvent.DispatcherState ds = decor.getKeyDispatcherState();
if (ds != null && ds.isTracking(event)) {
mMenu.close(true);
dialog.dismiss();
return true;
}
}
}
}
}