Inflater in Android Fragments

View rootView = inflater.inflate (R.layout.check_fragment, container, false);

What is the use of bool since false in this case? I'm starting to program on Android, can someone explain this to me in detail? Thanks in advance.

+4
source share
4 answers

https://developer.android.com/reference/android/view/LayoutInflater.html

If you set it to true, then the view will be automatically added to its parent element (second parameter). In most cases this should be false, but sometimes it is necessary, especially if you use <merge>as root in bloated xml.

+1
source

true " View container ". false ", View container , ".

FragmentManager View .

, container inflate(), , ( RelativeLayout) , .

0

? false, root LayoutParams XML.

0

docs:

attachToRoot - ? false, root LayoutParams XML.

false attach, ViewGroup, onCreateView. , Android . onCreateView, , .

true, , , , - .

0

Source: https://habr.com/ru/post/1622543/


All Articles