Closed SnailMyth closed 11 months ago
问题代码/截图(可选)/ Problem code or screenshot (optional): --BasePopupHelper:
static View findDecorView(Object parent) { View decorView = null; Window window = null; if (parent instanceof Dialog) { window = ((Dialog)parent).getWindow(); } else if (parent instanceof DialogFragment) { if (((DialogFragment)parent).getDialog() == null) { decorView = ((DialogFragment)parent).getView(); } else { window = ((DialogFragment)parent).getDialog().getWindow(); } } else if (parent instanceof Fragment) { decorView = ((Fragment)parent).getView(); } else if (parent instanceof Context) { Activity act = PopupUtils.getActivity((Context)parent); decorView = act == null ? null : act.findViewById(16908290); }
if (decorView != null) { return decorView; } else { return window == null ? null : window.getDecorView(); }
问题描述/重现步骤请写在这里 当parent是activity的时候window 没有被赋值 导致DecorView 为null
请问是什么activity
提issue前请去WIKI#常见问题查询相关问题,避免重复提问
Please go to WIKI#FAQ for relevant questions before commit your issue to avoid repetitive questions.
提issue前请务必参考以下格式填写,否则该问题会被直接关闭。
Please be sure to follow the format below before submitting the issue, otherwise the question will be actively closed!
问题代码/截图(可选)/ Problem code or screenshot (optional): --BasePopupHelper:
static View findDecorView(Object parent) { View decorView = null; Window window = null; if (parent instanceof Dialog) { window = ((Dialog)parent).getWindow(); } else if (parent instanceof DialogFragment) { if (((DialogFragment)parent).getDialog() == null) { decorView = ((DialogFragment)parent).getView(); } else { window = ((DialogFragment)parent).getDialog().getWindow(); } } else if (parent instanceof Fragment) { decorView = ((Fragment)parent).getView(); } else if (parent instanceof Context) { Activity act = PopupUtils.getActivity((Context)parent); decorView = act == null ? null : act.findViewById(16908290); }
}