【发布时间】:2015-03-24 15:23:18
【问题描述】:
我有一个文本框和一个按钮。当我点击按钮时,Google Now 会触发文本框中的文本。我正在使用下面的函数来启动带有文本的 Google Now。
public void searchWeb(String query)
{
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
intent.putExtra(SearchManager.QUERY, query);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
startActivity(intent);
}
问题是我只能在 Google Now 不处于运行状态时才能使用我的文本打开它。当它处于运行状态时,Google Now 页面会打开,但搜索查询不会更新为最新的。
我错过了什么吗?
【问题讨论】:
标签: android android-intent google-now