Android 添加新片段时无法添加窗口

Android 添加新片段时无法添加窗口,android,exception,fragment,Android,Exception,Fragment,我试图在一个活动上显示一个片段,并在打开的webview上显示。在API29中没有问题,但是如果我在API21-API23中测试它,它失败了,返回我 W/System.err: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application at android.view.ViewRootImpl.setView(ViewRootImpl.

我试图在一个活动上显示一个片段,并在打开的webview上显示。在API29中没有问题,但是如果我在API21-API23中测试它,它失败了,返回我

W/System.err: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
    at android.view.ViewRootImpl.setView(ViewRootImpl.java:566)
    at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:272)
    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
    at android.app.Dialog.show(Dialog.java:298)
    at com.android.org.chromium.content.browser.input.SelectPopupDialog.show(SelectPopupDialog.java:126)
    at com.android.org.chromium.content.browser.ContentViewCore.showSelectPopup(ContentViewCore.java:2467)
    at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
    at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:28)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5221)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
我没有使用对话框,因此,我不理解此消息。我正在加载带有下一个代码的片段

CommonSpinnerDialogFragment commonSelector = CommonSpinnerDialogFragment.newInstance(
                getSpinnerItemModels(models)
                , getCommonSpinnerItemSelectionListener()
                , title
        );

        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        Fragment prev = getSupportFragmentManager().findFragmentByTag("CommonSelector");
        if (prev != null) {
            ft.remove(prev);
        }
        ft.addToBackStack(null);
        ft.add(mContainerFragments.getId(), commonSelector,"CommonSelector");
        try {
            ft.commit();
        } catch (Exception e) {
            String methodName = new Object() {
            }.getClass().getEnclosingMethod().getName();
            ExceptionHandlerManager.printExceptionMessage(getActivity().getClass().getSimpleName(), methodName, e);
            ft.commitAllowingStateLoss();
        }
我不知道我做错了什么。这令人沮丧

谢谢