2
我定义我的活动之一,为搜索:Android为我们的搜索功能活动存储搜索词历史记录?
// manifest.xml
<meta-data
android:name="android.app.default_searchable"
android:value=".MyActivity" />
当用户点击搜索硬键,操作系统显示一个编辑框,用户可以输入查询,我得到叫回来无论用户输入什么文字并进行搜索。
下一次我点击搜索键时,它看起来像操作系统已经存储我以前的查询,建立一个我所有以前的搜索词列表。操作系统在哪里存储搜索条件的历史记录?我想知道它是否在安全的位置,因为历史可能对隐私敏感,
---------- update --------------- ----
更具体地讲,这是过程,其中我添加了建议:它存储在这里
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(
context,
"com.me.myprovider",
DATABASE_MODE_QUERIES);
suggestions.saveRecentQuery("the query", null);
http://developer.android.com/guide/topics/search/adding-recent-query-suggestions.html
感谢
这是一个sqlite数据库的方式。您可以像使用设备终端中的sqlite3程序(通过使用adb或终端仿真程序)的任何其他SQL数据库一样访问它,前提是您具有root用户访问权限...... – ToVine 2014-07-15 17:52:07