我正面临下面这个链接中解释的类似问题。但该解决方案尚未发布。请帮助解决。
Android M ClassCastException: FrameLayout$LayoutParams cannot be cast to WindowManager$LayoutParams
答案 0 :(得分:3)
无需使用DialogActivity。只需添加一个getParent()即可访问容器。
if (android.os.Build.VERSION.SDK_INT > 22) {
container = (View) pwindow.getContentView().getParent().getParent();
}else{
container = (View) pwindow.getContentView().getParent();
}