• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

Navigation Data Transfer Safe Args 강의중에서

24.04.24 17:08 작성 24.04.24 17:09 수정 조회수 84

0

override fun onCreateView(
    inflater: LayoutInflater, container: ViewGroup?,
    savedInstanceState: Bundle?,
): View? {
    val view = inflater.inflate(R.layout.fragment_blank1, container, false)
    val action = BlankFragment1Directions.actionBlankFragment1ToBlankFragment2("ABCDE")

위의 코드중에서 "ABCD" 부분에서 빨간줄이 생기고 오류가 나네요 ... 왜 그럴까요 ???

소스코드는 아래 GITHUB 에 올려두었습니다

https://github.com/dongguntechnology/NaviDataTransfer

 

답변 2

·

답변을 작성해보세요.

0

shafeel2님의 프로필

shafeel2

질문자

2024.04.25

Too many arguments for public final fun actionBlankFragment1ToBlankFragment2(): NavDirections defined in com.dongguninnovatiion.navidatatransfer.BlankFragment1Directions.Companion

 

이런메세지가 뜨는군요 ..

nav_test 부분을 이렇게 변경해보시겠어요?

<navigation xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/nav_test"
    app:startDestination="@id/blankFragment1">

    <fragment
        android:id="@+id/blankFragment1"
        android:name="com.dongguninnovatiion.navidatatransfer.BlankFragment1"
        android:label="fragment_blank1"
        tools:layout="@layout/fragment_blank1" >
        <action
            android:id="@+id/action_blankFragment1_to_blankFragment2"
            app:destination="@id/blankFragment2" />
    </fragment>

    <fragment
        android:id="@+id/blankFragment2"
        android:name="com.dongguninnovatiion.navidatatransfer.BlankFragment2"
        android:label="fragment_blank2"
        tools:layout="@layout/fragment_blank2" >
        <argument
            android:name="key"
            app:argType="string"
            android:defaultValue="Corea(Core)" />
        <action
            android:id="@+id/action_blankFragment2_to_blankFragment1"
            app:destination="@id/blankFragment1" />
    </fragment>
</navigation>

0

안녕하세요

어떤 오류메세지가 나오고, 빌드하면 어떤 메세지가 나오나요?