本文整理了Java中android.widget.SearchView.<init>()
方法的一些代码示例,展示了SearchView.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SearchView.<init>()
方法的具体详情如下:
包路径:android.widget.SearchView
类名称:SearchView
方法名:<init>
暂无
代码示例来源:origin: stackoverflow.com
var search_view = new SearchView({ el: $("#search_container") });
代码示例来源:origin: stackoverflow.com
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ActionBar actionBar = getActionBar();
SearchView searchView = new SearchView(this);
actionBar.setCustomView(searchView);
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
searchView.setQuery("test",true);
searchView.setFocusable(true);
searchView.setIconified(false);
searchView.requestFocusFromTouch();
}
代码示例来源:origin: stackoverflow.com
SearchView searchview = new SearchView(this);
SearchManager searchManager = (SearchManager) getSystemService(SEARCH_SERVICE);
searchview.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
代码示例来源:origin: stackoverflow.com
public class MenuActivity extends Activity {
public static Button searchButton;
@Override
protected void onCreate() {
SearchView searchView = new SearchView(this);
}
}
代码示例来源:origin: stackoverflow.com
SearchView searchView = new SearchView();
searchView.Close += (sender, e) =>
{
// Do stuff here
};
代码示例来源:origin: stackoverflow.com
this.svPet = new SearchView(this);
MenuItemCompat.setShowAsAction(searchItem, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
MenuItemCompat.setActionView(searchItem, this.svPet);
代码示例来源:origin: com.google.android/support-v4
public static View newSearchView(Context context) {
return new SearchView(context);
}
代码示例来源:origin: stackoverflow.com
searchView = new SearchView()
$('div').append(searchView.render().el) # 'div' is just an example of course
代码示例来源:origin: stackoverflow.com
<body>
<div class="container"></div>
<script type="text/javascript">
var SearchView = Backbone.View.extend({
el: '.container',
initialize: function() {
this.render();
},
render: function() {
$(this.el).html("hello"); //tried both but not working.
this.$el.html("hello");
}
});
var search_view = new SearchView();
</script>
</body>
代码示例来源:origin: kingargyle/adt-leanback-support
public static View newSearchView(Context context) {
return new SearchView(context);
}
代码示例来源:origin: stackoverflow.com
SearchView sView = new SearchView();
//In this moment your var are null.
代码示例来源:origin: stackoverflow.com
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js"></script>
<script type="text/template" id="search_template">
<label>Search</label>
<input type="text" id="search_input" />
<input type="button" id="search_button" value="Search" />
</script>
<script type="text/javascript">
SearchView = Backbone.View.extend({
render: function() {
var template = _.template($("#search_template").html(), {});
this.$el.html(template);
}
});
var search_view = new SearchView();
search_view.render();
document.write(search_view.$el.html());
</script>
代码示例来源:origin: stackoverflow.com
//Other activity or class
//Declare a new var as your class
SearchView sView = new SearchView();
MenuActivity nMenu = sView.getMenuActivityVar();
代码示例来源:origin: stackoverflow.com
@Override
public boolean onCreateOptionsMenu(Menu menu) {
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
SearchView searchView = new SearchView(this);
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
getActionBar().setDisplayShowCustomEnabled(true);
getActionBar().setCustomView(searchView, new ActionBar.LayoutParams(Gravity.RIGHT));
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
代码示例来源:origin: stackoverflow.com
@Override
public boolean onQueryTextChange(String newText) {
return false;
}
@Override
public boolean onQueryTextSubmit(String arg0) {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
//Create the search view
SearchView searchView = new SearchView(this);
searchView.setQueryHint("Search for Tracks...");
searchView.setOnQueryTextListener(this);
menu.add("Search")
.setIcon(R.drawable.ic_action_search)
.setActionView(searchView)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
return super.onCreateOptionsMenu(menu);
}
代码示例来源:origin: stackoverflow.com
@Override
public boolean onCreateOptionsMenu(Menu menu) {
SearchView searchView = new SearchView(this);
searchView.setQueryHint(getString(R.string.search_hint));
searchView.setOnQueryTextListener(new OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
// what to do on submit, e.g. start an Activity and pass the query param
return true;
}
@Override
public boolean onQueryTextChange(String newText) {
return false;
}
});
menu.add(getString(R.string.search_title))
.setIcon(R.drawable.ic_action_search)
.setActionView(searchView)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM|MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
// ...place to add other menu items
return super.onCreateOptionsMenu(menu);
}
代码示例来源:origin: stackoverflow.com
setContentView(relative);
SearchView searchView = new SearchView(this);
searchView.setIconifiedByDefault(false);
traverseView(searchView, 0);
代码示例来源:origin: stackoverflow.com
actionBar.setDisplayShowTitleEnabled(false);
SearchView searchView = new SearchView(this);
searchView.setIconifiedByDefault(false);
searchView.setMaxWidth(Integer.MAX_VALUE);
代码示例来源:origin: stackoverflow.com
mSearchView = new SearchView(this);
mSearchView.setOnSearchListener(this);
代码示例来源:origin: IvanVolosyuk/diskusage
@Override
public MenuItem makeSearchMenuEntry(Menu menu) {
MenuItem item = menu.add("Search");
searchView = new SearchView(diskusage);
origSearchBackground = searchView.getBackground();
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
内容来源于网络,如有侵权,请联系作者删除!