here's my code:
public MyPresentation(Context outerContext, Display display) {
super(outerContext, display);
WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
View rootView = getWindow().getDecorView().getRootView();
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.x=300;
lp.y=300;
lp.width=lp.height=500;
wm.updateViewLayout(rootView, lp);
}
As you can see, I'm trying to change params of my presentation through window manager.But got exception bellow:
Java.lang.IllegalArgumentException:View=com.android.internal.policy.impl.PhoneWindow$DecorView{164f32fc V.E..... R.....ID 0,0-0,0} not attached to window manager
at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:466)
at android.view.WindowManagerGlobal.updateViewLayout(WindowManagerGlobal.java:322)
at android.view.WindowManagerImpl.updateViewLayout(WindowManagerImpl.java:91)
at com.evideostb.cbb.diveintotv.MyPresentation$override.init$body(MyPresentation.java:30)
at com.evideostb.cbb.diveintotv.MyPresentation$override.access$dispatch(MyPresentation.java)
at com.evideostb.cbb.diveintotv.MyPresentation.<init>(MyPresentation.java:0)
So how can I get the root view of presentation which attach to window manager?