Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 我如何才能让我的SearchView记住以前的搜索,比如它在游戏市场中的表现?_Android_Searchview - Fatal编程技术网

Android 我如何才能让我的SearchView记住以前的搜索,比如它在游戏市场中的表现?

Android 我如何才能让我的SearchView记住以前的搜索,比如它在游戏市场中的表现?,android,searchview,Android,Searchview,我希望在单击包含以前搜索列表的“搜索”视图下显示一个下拉列表 @Override public boolean onCreateOptionsMenu(Menu menu) { getSupportMenuInflater().inflate(R.menu.categories, menu); // Get the SearchView and set the searchable configuration SearchView sear

我希望在单击包含以前搜索列表的“搜索”视图下显示一个下拉列表

@Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getSupportMenuInflater().inflate(R.menu.categories, menu);
        // Get the SearchView and set the searchable configuration
        SearchView searchView = (SearchView) menu.findItem(R.id.menu_search)
        .getActionView();
        searchView.setQueryHint("Search All Categories");

        final AppListAdapter adapterAllApps = new AppListAdapter(
                CategoryListActivity.this, R.layout.app_row, catList);
        searchView.setOnQueryTextListener(new OnQueryTextListener() {
            @Override
            public boolean onQueryTextChange(String newText) {
    ....

您可能需要使用

AutoCompleteTextView
要执行此操作,请添加可搜索的内容提供商

看看这个:


我已经有了。我的自动完成功能现在运行良好,除了历史。我需要知道如何让它显示之前搜索的术语: