Skip to content

Commit a88bd14

Browse files
lukstbitdavid-allison
authored andcommitted
Fix incorrect MenuItem.actionView cast in ManageNoteTypes
Current code has a bug where the menu item was cast as an AccessibleSearchView instead of the menu item's action view.
1 parent 067c95f commit a88bd14

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

AnkiDroid/src/main/java/com/ichi2/anki/notetype/ManageNotetypes.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ class ManageNotetypes : AnkiActivity(R.layout.activity_manage_note_types) {
138138
state.noteTypes.size,
139139
)
140140
if (state.searchQuery.isNotEmpty()) {
141-
val searchView =
142-
findViewById<Toolbar>(R.id.toolbar).menu?.findItem(R.id.search_item) as? AccessibleSearchView
141+
val searchMenuItem = findViewById<Toolbar>(R.id.toolbar).menu?.findItem(R.id.search_item)
142+
val searchView = searchMenuItem?.actionView as? AccessibleSearchView
143143
searchView?.setQuery(state.searchQuery, false)
144144
}
145145
}

0 commit comments

Comments
 (0)