我想在android Scala eclipse插件中实现android的搜索方法:
我有这个方法:
val queryListener = new OnQueryTextListener() {
override def onQueryTextChange(newText: String): Boolean = {
if (TextUtils.isEmpty(newText)) {
getActivity.getActionBar.setSubtitle("List")
val grid_currentQuery = null
} else {
getActivity.getActionBar.setSubtitle("List - Searching for: " + newText)
val grid_currentQuery = newText
}
getLoaderManager.restartLoader(0, null, this)
false
}
在这一行“getLoaderManager.restartLoader(0, null, this)”我对“this”有一个错误,我的错误是:
type mismatch; found : android.widget.SearchView.OnQueryTextListener required:
android.support.v4.app.LoaderManager.LoaderCallbacks[?]
你能帮我完成这个实现吗
提前致谢!
更新 1:
以前用过,还是报错
getLoaderManager.restartLoader(0, null, BooksFragment.this)
我的错误是:
Multiple markers at this line
- type mismatch; found : com.android.BooksFragment required:
android.support.v4.app.LoaderManager.LoaderCallbacks[?]
- type mismatch; found : com.android.BooksFragment required: