I am trying to create a WindowManager with some LayoutParams,create an activity and attach the latter to it.
I know I could create the activity first and then get the Window in which it was created and then apply the parameters like so
myActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
But can it be done the other way around?