I'm sorry if I'm asking a basic question, but I'm new to android app programming.
I have a class written in kotlin along the following path: package com.albs.calendar
And a class written in Java along the following path: package com.albs.ui.gallery;
I'm trying to import kotlin into java (import com.albs.calendar.Example5Fragment;), but at the build stage I get the following error:
error: package com.albs.calendar does not exist
import com.albs.calendar.Example5Fragment;
Here is the code of Example5Fragment:
package com.albs.calendar
class Example5Fragment : BaseFragment(R.layout.example_5_fragment), HasToolbar {
override val toolbar: Toolbar?
get() = null
override val titleRes: Int = R.string.example_5_title
private var selectedDate: LocalDate? = null
private val monthTitleFormatter = DateTimeFormatter.ofPattern("MMMM")
private val flightsAdapter = Example5FlightsAdapter()
private val flights = generateFlights().groupBy { it.time.toLocalDate() }
private lateinit var binding: Example5FragmentBinding
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding = Example5FragmentBinding.bind(view)
...
}
override fun onStart() {
super.onStart()
// requireActivity().window.statusBarColor = requireContext().getColorCompat(R.color.example_5_toolbar_color)
}
override fun onStop() {
super.onStop()
// requireActivity().window.statusBarColor = requireContext().getColorCompat(R.color.colorPrimaryDark)
}
private fun updateAdapterForDate(date: LocalDate?) {
flightsAdapter.flights.clear()
flightsAdapter.flights.addAll(flights[date].orEmpty())
flightsAdapter.notifyDataSetChanged()
}
}
UPD2 The problem was solved by creating a new project and moving the code there.

