Kotlin interface not stricter than Java superclass

Intrinsic check in Kotlin if view is null lead to crashes.
view is not even used so we can accept null.
This commit is contained in:
AdrianLxM 2020-05-10 16:56:48 +02:00 committed by GitHub
parent 15207d1bf1
commit cd84597058
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,7 +58,7 @@ class FoodFragment : DaggerFragment() {
filterData() filterData()
} }
food_category.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { food_category.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) { override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
fillSubcategories() fillSubcategories()
filterData() filterData()
} }
@ -69,7 +69,7 @@ class FoodFragment : DaggerFragment() {
} }
} }
food_subcategory.setOnItemSelectedListener(object : AdapterView.OnItemSelectedListener { food_subcategory.setOnItemSelectedListener(object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) { override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
filterData() filterData()
} }