Merge "Fix NPE in PopupMenu.getDragToOpenListener()" into klp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6bc7cacfc8
@@ -92,8 +92,21 @@ public class PopupMenu implements MenuBuilder.Callback, MenuPresenter.Callback {
|
||||
public OnTouchListener getDragToOpenListener() {
|
||||
if (mDragListener == null) {
|
||||
mDragListener = new ForwardingListener(mAnchor) {
|
||||
@Override
|
||||
protected boolean onForwardingStarted() {
|
||||
show();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onForwardingStopped() {
|
||||
dismiss();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListPopupWindow getPopup() {
|
||||
// This will be null until show() is called.
|
||||
return mPopup.getPopup();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user