Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

binding fragment android

example:

public View onCreateView(LayoutInflater inflater, 
                         @Nullable ViewGroup container, 
                         @Nullable Bundle savedInstanceState) {
    MartianDataBinding binding = DataBindingUtil.inflate(
            inflater, R.layout.martian_data, container, false);
    View view = binding.getRoot();
    //here data must be an instance of the class MarsDataProvider
    binding.setMarsdata(data);
    return view;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #binding #fragment #android
ADD COMMENT
Topic
Name
4+1 =