adding a search related crashfix

This commit is contained in:
tibbi 2018-07-18 10:50:30 +02:00
parent e90d5334c4
commit c71593e90f

View file

@ -261,7 +261,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
private fun setupSearch(menu: Menu) { private fun setupSearch(menu: Menu) {
val searchManager = getSystemService(Context.SEARCH_SERVICE) as SearchManager val searchManager = getSystemService(Context.SEARCH_SERVICE) as SearchManager
mSearchMenuItem = menu.findItem(R.id.search) mSearchMenuItem = menu.findItem(R.id.search)
(mSearchMenuItem!!.actionView as SearchView).apply { (mSearchMenuItem?.actionView as? SearchView)?.apply {
setSearchableInfo(searchManager.getSearchableInfo(componentName)) setSearchableInfo(searchManager.getSearchableInfo(componentName))
isSubmitButtonEnabled = false isSubmitButtonEnabled = false
setOnQueryTextListener(object : SearchView.OnQueryTextListener { setOnQueryTextListener(object : SearchView.OnQueryTextListener {