2

I am trying to dismiss a popup window which was created in TextView class. The popup window is created as:

    PopupWindow mPopupWindow;
    mPopupWindow =new PopupWindow(mTextView.getContext(), null,
                          com.android.internal.R.attr.textSelectHandleWindowStyle);   
    mPopupWindow.setClippingEnabled(true);
    mPopupWindow.setWindowLayoutType(WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL);
    mPopupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);

I don't have any reference to that popup window. But I need to dismiss it. So, Is there any way to dismiss all the popup windows in Window Manager?

Thanks.

Vijay
  • 545
  • 1
  • 5
  • 15
  • Can you add your full code here? – Foram Shah Jan 09 '17 at 06:37
  • please add full code related to popupWindow – W4R10CK Jan 09 '17 at 06:44
  • Hi @ForamShah, I added full code. Please check and let me know if you can help me. – Vijay Jan 09 '17 at 07:01
  • @W4R10CK, I added full code here. Please have a look at it and let me know if you found the answer. – Vijay Jan 09 '17 at 07:02
  • do u want to cancel the window on outside touch? – W4R10CK Jan 09 '17 at 07:04
  • @W4R10CK No. I don't have the reference object of PopupWindow. If I had I would have cancelled by `mPopupWindow.dismiss();` The PopupWindow reference is private in EasyEditPopupWindow.java class. Without reference object I can't dismiss that window. So what I am looking is dismissing a PopWindow using WindowManager or something. – Vijay Jan 09 '17 at 07:11
  • you can make getter method in EasyEditPopupWindow.java to access private PopupWindow reference and dismiss it from outside the class. – Foram Shah Jan 09 '17 at 07:20

0 Answers0