1.在
2.用
例如:
执行查询:
当你的activity启动时,通过下面的代码来获得查询:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.search);
// 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);
doMySearch(query);
}
}
doMySearch(query)是你自己的函数,用来完成查询的具体工作。