问题标签 [inline-method]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
35 浏览

android - 无法从 onCreateOptionsMenu 调用内联 fun SearchView.OnQueryTextListener

在这个应用程序中,我尝试SearchView.OnQueryTextListener像这样在单独的 kotlin 文件中实现

但是当我尝试在片段中使用它时,我在其他方法中看不到它,我看到了这个错误Interface OnQueryTextListener does not have constructors

在此处输入图像描述

片段的完整代码