Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the relation between a DecorView and ViewRootImpl in Android?

I am not sure I understand the relation between the two. As I understand ViewRootImpl holds mView which is the main view per window, and DecorView is also the main view per window?

like image 394
EyalBellisha Avatar asked Nov 30 '25 04:11

EyalBellisha


2 Answers

It turns out that the mView inside ViewRootImpl IS DecorView so this answers my own question

like image 144
EyalBellisha Avatar answered Dec 02 '25 21:12

EyalBellisha


ViewRootImpl is the top of the view hierarchy, it implements the needed protocol between View and the WindowManager.

DecorView is the true root of the Window's view hierarchy. It contains both the "decor" (i.e. the window's title, and also contains the content view.

enter image description here enter image description here

like image 25
Mike Yang Avatar answered Dec 02 '25 21:12

Mike Yang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!