本文整理了Java中android.support.v7.widget.SearchView.getContext()
方法的一些代码示例,展示了SearchView.getContext()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SearchView.getContext()
方法的具体详情如下:
包路径:android.support.v7.widget.SearchView
类名称:SearchView
方法名:getContext
暂无
代码示例来源:origin: square/assertj-android
public SearchViewAssert hasQueryHint(int resId) {
isNotNull();
return hasQueryHint(actual.getContext().getString(resId));
}
代码示例来源:origin: amahi/android
private void setSearchCursor() {
final int textViewID = searchView.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
final AutoCompleteTextView searchTextView = searchView.findViewById(textViewID);
try {
Field mCursorDrawableRes = TextView.class.getDeclaredField("mCursorDrawableRes");
mCursorDrawableRes.setAccessible(true);
mCursorDrawableRes.set(searchTextView, R.drawable.white_cursor);
} catch (Exception ignored) {
}
}
代码示例来源:origin: algolia/instantsearch-android
/**
* Returns the context the view is running in, through which it can
* access the current theme, resources, etc.
*
* @return The view's Context.
*/
@NonNull public Context getContext() {
if (searchView != null) {
return searchView.getContext();
} else if (supportView != null) {
return supportView.getContext();
}
throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
}
内容来源于网络,如有侵权,请联系作者删除!