Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的搜索正在使用操作栏搜索小部件进行。现在我想根据调用搜索的活动的输入来过滤我的搜索结果。我不知道如何向可搜索活动发送额外数据。我需要帮助吗?
在您的意图中,添加数据:
Intent intent = new Intent(this, DisplayMessageActivity.class); intent.putExtra("filter", filter); startActivity(intent)
然后读取搜索活动中的数据:
Intent intent = getIntent(); String filter = intent.getStringExtra("filter");