1

我的搜索正在使用操作栏搜索小部件进行。现在我想根据调用搜索的活动的输入来过滤我的搜索结果。我不知道如何向可搜索活动发送额外数据。我需要帮助吗?

4

1 回答 1

0

在您的意图中,添加数据:

Intent intent = new Intent(this, DisplayMessageActivity.class);
intent.putExtra("filter", filter);
startActivity(intent)

然后读取搜索活动中的数据:

Intent intent = getIntent();
String filter = intent.getStringExtra("filter");
于 2013-07-23T18:34:23.710 回答