If you encounter this error message, I figure you used the requestWindowFeature() method in a class that already inherits from Activity. Say, PreferenceActivity perhaps?
While the rule to use this method should be before one sets the content view of the Activity, in the case of a PreferenceActivity class, it is different.
Since super.onCreate() is called, the ViewGroup is set up so you are not allowed to change the Window‘s parameters.
The workaround for this is to call the requestWindowFeature() method first before super.onCreate(). That should fix it.