Совсем недавно начал изучать Android Studio. По гайду сделал bottomnavigation, подключил к нему фрагменты, после чего попытался запустить приложение, но возникла следующая ошибка:
C:\Users\kerso\AndroidStudioProjects\Taschool\app\src\main\java\com\specus\taschool\ui\dashboard\DashboardFragment.java:13: error: cannot find symbol
import com.specus.taschool.databinding.FragmentDashboardBinding;
^
symbol: class FragmentDashboardBinding
location: package com.specus.taschool.databinding
Код в FragmentDashboardBinding:
package com.specus.taschool.ui.dashboard;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import com.specus.taschool.databinding.FragmentDashboardBinding;
public class DashboardFragment extends Fragment {
private FragmentDashboardBinding binding;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
DashboardViewModel dashboardViewModel =
new ViewModelProvider(this).get(DashboardViewModel.class);
binding = FragmentDashboardBinding.inflate(inflater, container, false);
View root = binding.getRoot();
final TextView textView = binding.textDashboard;
dashboardViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
return root;
}
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
}
}