android,kotlin2023. 10. 17. 13:52

[kotlin]Navigation action cannot be found from the current destination Destination 해결방법

 

navigation 쓰는데... destination 찾을수가 없단다..

 

분명 로직은 잘 된거라 생각했는데..

 

왜 그런가 했더니.. 연결을 잘못 해준거엿다..

 

내 경우를 설명들어..

 

tab 3개 있고... parent fragment 밑에 3개의 child fragment가 있는데.. 

 

child fragment -> child detail fragment로 이동시키기 위해 action을 했다... 그래서 위와같이 에러가 나왔다.

 

알고봤더니

 

parent 에서 child detail fragment 로 action 해야한다..

 

findNavController().currentDestination 

-> 디버깅 해보면 parent fragment로 되어있은걸 확인해볼 수 있다..
Posted by thdeodls85