This image came from the official documents.But I don't understand one of the words:"or else simply an object that provides a set of LayoutParams values for root of the returned hierarchy (if attachToRoot is false.)"
Can you explain it for me?
This image came from the official documents.But I don't understand one of the words:"or else simply an object that provides a set of LayoutParams values for root of the returned hierarchy (if attachToRoot is false.)"
Can you explain it for me?
Inflate is used to add a view, especially used for inflating fragments inside an activity. ViewGroup root is the parent view in which you want to inflate your view. If you are using this function to inflate a fragment then use it like this:
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_name,container,false); return view; }
If this does not answer your query then let me know in what context are you exactly using inflate.