I'm trying to implement a simple rating bar (`rb`) in Android Studio using Kotlin. To test out the rating bar (X stars out of 5), I'm using the Toast function to display the designated rating value upon clicking the "Apply" button (`button`). I'm currently working in a fragment, which I believe is the source of my issue. All of this code is within the fragment's `override fun onCreateView(...)): View? {` section. 

```
    btn = root.findViewById<View>(R.id.button) as Button
    rb = root.findViewById<View>(R.id.rb) as RatingBar

    fun click(view: View) {
        val ratingvalue = rb.rating
        Toast.makeText(context!!, "Rating is: " + ratingvalue, Toast.LENGTH_LONG).show()
    }

```

The function name `click` is grayed-out, stating that it is never called. To clarify, I have designated this to be the button's onClick function name, as so: `android:onClick="click"`. When clicking the button, no text shows up and the app crashes.

Any insight to this issue would be greatly appreciated.