android – What is the purpose of requestWindowFeature()?-ThrowExceptions

Exception or error:

What does requestWindowFeature() do? I used it to create a custom titlebar, but I don’t really understand what its purpose is.

The explanation provided in the SDK documentation here does not make sense.

How to solve:

Each activity has an associated window (on which the whole UI draws). This window has default way of being drawn (whether toolbar, actionbar, icons are drawn or not).

However, you can use requestWindowFeature to ask the system to include or exclude some of windows features (toolbar, actionbar and so on).

Here you can find the full list of supported features: http://developer.android.com/reference/android/view/Window.html

As example, you can use FEATURE_NO_TITLE to make a window full screen or FEATURE_RIGHT_ICON to let system know that icon should be drawn on the right side.

Leave a Reply

Your email address will not be published. Required fields are marked *