我正在尝试使用Android的搜索管理器。搜索界面在搜索时打开新的活动
其实,我在那里,我呼吁
onSearchRequested()
接着一个活动,我正在使用相同的活动这个函数来获取搜索字符串:
// Get the intent, verify the action and get the query
Intent intent = getIntent();
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
String query = intent.getStringExtra(SearchManager.QUERY);
}
问题是接下来:当我点击搜索按钮时,我打开一个新的活动,我想保持不变,并进行一些搜索。因此,我的目标是在点击搜索按钮时避免新的活动开放。
谢谢。