Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of requestWindowFeature()?

Tags:

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.

like image 978
DuyguK Avatar asked Oct 01 '12 19:10

DuyguK


1 Answers

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.

like image 121
Victor Ronin Avatar answered Nov 29 '22 00:11

Victor Ronin