0

What is the difference b/w these two:

FrameLayout customView = (FrameLayout) view.getRootView();  


FrameLayout customView = (FrameLayout) activity.getWindow().getDecorView();   
cathulhu
  • 641
  • 1
  • 9
  • 20
VJohn
  • 493
  • 1
  • 14
  • 23

2 Answers2

2

activity.getWindow().getDecorView(); it gives refernce to the outermost layout... while view.getRootView() gives the refernce to the layout containing the view..

karan421
  • 863
  • 17
  • 43
0

I think getRootView() finds the topmost view in the current ViewGroup where getDecorView returns an instance of all the items of ViewGroup.

Yash Krishnan
  • 2,653
  • 1
  • 18
  • 22