41.9 Adding View Binding Support to the Destination Fragments
Since we will be accessing some of the views in the fragment layouts we will need to modify the current code to enable view binding support. Begin by editing the MainFragment.kt file and making the following changes:
.
.
import com.ebookfrenzy.navigationdemo.databinding.MainFragmentBinding;
.
.
public class MainFragment extends Fragment {
private MainViewModel mViewModel;
private MainFragmentBinding binding;
public static MainFragment newInstance() {
return new MainFragment();
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
...