I am getting exception when i am going to removeView(View view)
in the Window Manager.
wm = (WindowManager) getSystemService(WINDOW_SERVICE);
AntView mView=new AntView(getApplicationContext());
wm.removeView(mView1);
When i try the above code it shows me an Exception:
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)