当我要进入removeView(View view)
窗口管理器时,我遇到了异常。
wm = (WindowManager) getSystemService(WINDOW_SERVICE);
AntView mView=new AntView(getApplicationContext());
wm.removeView(mView1);
当我尝试上面的代码时,它向我显示了一个异常:
Caused by: java.lang.IllegalArgumentException: View not attached to window manager
at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:381)
at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:226)
at com.example.testactivity.BackService.onStartCommand(BackService.java:63)
0 at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2051)