WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL not working on latest phones


I develop an Android game and I need a modeless dialog; a dialog which, when shown on the screen, does not block touch events being sent to area outside the dialog.

Thus I have followed the advice given in

and I have such dialog, except that extensive testing proves that it does not work on some Samsung phones.

Here’s how I initialize my dialog:


public class MyDialog extends AppCompatDialogFragment
public void onStart()

Dialog dialog = getDialog();

if( dialog!=null )

  Window window = dialog.getWindow();

  if( window!=null )

I have tested the above on emulators and many real phones. Results:

Works on all emulators, on LG Nexus 5X (Android 8.1) on HTC Desire 12, on several Huawei phones, on all older ( running Android 8.1.0 and below ) Samsung phones. But on new Samsung phones, every single one running Android 9 or 10, the above does not work - if I try to click on a Button that’s outside the Dialog, the Button’s onClick() method never gets called.

It is thus as if the flag FLAG_NOT_TOUCH_MODAL was not working.

Any pointers? Workarounds?