Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an Android DecorView?

http://developer.android.com/reference/android/view/Window.html#getDecorView():

Retrieve the top-level window decor view (containing the standard window frame/decorations and the client's content inside of that), which can be added as a window to the window manager.

This is baffling. It is not clear what the standard "window frame/decorations" are. I'm at a loss as to what this is, exactly, and the documentation is terrible. Does it exist inside the application's window? Does it surround the application's window?

I have never seen an Android window with noticeable window decorations. And "which can be added as a window" implies that a decor view is a window, but that contradicts the class hierarchy (View is not a subclass of Window).

So what's the deal? What exactly is the decor view?

like image 594
nmr Avatar asked Apr 24 '14 18:04

nmr


1 Answers

Seems that one of the places where it's best defined is in Romain Guy's Blog:

The DecorView is the view that actually holds the window’s background drawable. Calling getWindow().setBackgroundDrawable() from your Activity changes the background of the window by changing the DecorView‘s background drawable. As mentioned before, this setup is very specific to the current implementation of Android and can change in a future version or even on another device.

like image 85
nKn Avatar answered Sep 30 '22 21:09

nKn