How to access a function ,written in a fragment, in an activity
I have created a function in a fragment that gets data from the fragment's UI. I would want to access it in my main Activity so as to store the data in cloud firestore
This is the function in the fragment
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
fun getData(){
var dairyMealStock: Int = view?.findViewById(R.id.et_dairy_meal_stock)?.text.toString().toInt()
var dairyMealDuration: Int =...