代码大概如下
windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
windowManager.addView(linearLayout, layoutParams);
protected void onDestroy() {
windowManager.removeView(linearLayout);
super.onDestroy();
}
我在activity onDestory()时调用了windowManager的removeView()方法也不行,还是会报相同的错误。难道
说removeView()方法调用后创建的Window还会存在么?应该如何彻底删除这个Window。
I answered it myself, just use the removeViewImmediate() method instead of the removeView() method