Trying to do fragment navigation but android studio wants to reference a file that doesn't exist

Viewed 36

the file name is IslandListFragment.kt and its partner is fragment_island_list.xml of course

unless i'm mistaken, the code should be

override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_island_list, container, false)

but instead of

 return inflater.inflate(R.layout.fragment_island_list, container, false)

android studio wants me to use

return inflater.inflate(R.layout.fragment_island_name, container, false)

fragment_island_list exists, fragment_island_name does not exist and trying to run this code in either form crashes the app.

any idea what i am missing here?

1 Answers

Try File->Invalidate caches/restart

Related