Hi everyone,
Im trying to create a UI for a fragment in an app. When i use onCreateView i have to use a layout file. How do i create a layout from code and use that.
I need to do this because my the content for the layout is from the server
This is what i have in my fragment class
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_storelist, container, false);
}
This is what i want to do
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(getLayoutFunction(), container, false);
}
I just want to fill the layout in code. Thats all
Thanks