我正在使用Android Studio中的导航架构组件。 我将其与底部的应用程序栏一起使用,并且效果很好,但是每当我尝试添加操作时,在启动应用程序时都会出现此错误(错误:找不到符号类“ ActionOnlyNavDirections”)
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph"
app:startDestination="@id/Around">
android:id="@+id/Around"
android:name="com.Czynt.kazdoura.AroundFragment"
android:label="fragment_around"
tools:layout="@layout/fragment_around">
android:id="@+id/action_Around_to_listView"
app:destination="@id/listView" />
android:id="@+id/listView"
android:name="com.Czynt.kazdoura.ListView"
android:label="fragment_list_view"
tools:layout="@layout/fragment_list_view" />
public class AroundFragment extends Fragment{
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
TabItem listTab = getActivity().findViewById(R.id.listTab);
listTab.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_Around_to_listView,null));
801

被折叠的 条评论
为什么被折叠?



