title: PopupWindow - not working on a few devices
body: <p>I use following code to show a small popup:</p>
  
  <pre><code>public static PopupWindow showImportMenu(Activity activity, View anchor, PopupWindowClickListener onClickListener)
  {
      LayoutInflater inflater = LayoutInflater.from(activity);
  
      PopupImportBinding binding = DataBindingUtil.inflate(inflater, R.layout.popup_import, null, false);
  
      if (!RootTools.isRootAvailable())
          binding.llImportRootMethod.setVisibility(View.GONE);
  
  
      PopupWindow popupWindow = new PopupWindow(activity, null, R.attr.popupMenuStyle);
      popupWindow.setFocusable(true);
      popupWindow.setContentView(binding.getRoot());
      popupWindow.setOutsideTouchable(true);
      PopupWindowCompat.showAsDropDown(popupWindow, anchor, 0, 0, Gravity.BOTTOM);
  
      View.OnClickListener clickListener = new View.OnClickListener()
      {
          @Override
          public void onClick(View view)
          {
              onClickListener.onClick(popupWindow, view);
          }
      };
  
      binding.llImportDefault.setOnClickListener(clickListener);
      binding.llImportRootMethod.setOnClickListener(clickListener);
      binding.llImportHTCFromContacts.setOnClickListener(clickListener);
      binding.llImportManual.setOnClickListener(clickListener);
  
      return popupWindow;
  }
  </code></pre>
  
  <p>This works on a lot of devices but on some rare devices it does not work, like:</p>
  
  <ul>
  <li>Android 5.1.1 root slim rom</li>
  <li>maybe others... until now, I don't know more about other devices</li>
  </ul>
  
  <p>I got the feedback that no popup is shown. Does anyone know why this is not working on the above mentioned device? And what I can do to make it work on this device as well?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>It seems like it's not clear that what I want is following:</p>
  
  <ul>
  <li>use <code>showAsDropDown</code> not <code>showAtLocation</code> or similar, I never saw this problem with <code>showAtLocation</code> yet</li>
  <li>my solution is working on nearly all devices, it seems to be a phone/rom specific problem, maybe it's not even solvable as it COULD be a bug in the device as well => if someone knows of such a bug, telling me would be fine as well</li>
  <li>I don't want to use a dialog (or anything else) instead, that's not answering my question. I currently use a <code>BottomSheet</code> which is fine for me, but still I would like to know if the problem can be solved and somehow handled</li>
  </ul>