Answers for "i cant use binding in my fragment"

1

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;
}
Posted by: Guest on January-28-2021

Code answers related to "i cant use binding in my fragment"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language