android


Keep different search histories for different activities?


I have two activities, and I'd like them to each maintain their own search history suggestions. Is that possible? They each have their own search suggestion provider, but I see the same search history appearing for both activities:
// manifest.xml
<activity
android:name="ActivityA"
...
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable_A" />
</activity>
<activity
android:name="ActivityB"
...
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable_B" />
</activity>
// searchable_A.xml
<searchable
android:searchSuggestAuthority="providerA" />
// searchable_B.xml
<searchable
android:searchSuggestAuthority="providerB" />
When saving the search suggestions, I'm making sure to use the correct provider for each activity.
// ActivityA.java
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(ActivityA.this,
providerA.AUTHORITY, providerA.MODE);
suggestions.saveRecentQuery(...);
// ActivityB.java
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(ActivityB.this,
providerB.AUTHORITY, providerB.MODE);
suggestions.saveRecentQuery(...);
Since the search suggestion providers are different, I was expecting them to each maintain a different history. The use case here is that I have an Activity dedicated to cars, and an Activity dedicated to foods. I don't want past search terms to be mixed together, they don't make sense in the different contexts.
http://developer.android.com/guide/topics/search/adding-recent-query-suggestions.html

Related Links

Google Play Services AdMob Ads not displaying
Trying to create mobileapp store using WSO2 ES
Display data in listview depending on the session of the user
“android.content.res.Resources$NotFoundException:” in Robolectric test
Picasso: load images to widget listview
Doing sensor fusion in Android NDK
Many many issues, eclipse, android MediaPlayer, etc
connectedAndroidTest - Task has not declared any outputs
traverse nested xml file android
How to scale a bitmap in android
Writting custom functionality of google cloud messaging service
Android Application launches with wrong resolution
Align button top to textview end
Save Toggle Button State with Different Image Android
How big is the stack, and how much have I used up?
Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 20 declared

Categories

HOME
prism
c99
telegram
wakanda
battery
pclxl
access
3d-reconstruction
zip
mapbox
jquery-ui
little-proxy
github-enterprise
automatic-ref-counting
flatpak
capistrano3
package.json
mapstruct
sar
blade
ember-cli
ios10.2
parcelable
imageresizer
exploit
perlbrew
surveymonkey
fat
underscore.js
android-things
errbot
failover
alm
userdefaults
recurring-events
simplecv
vue-chartjs
html-encode
mnist
apic
parse-tree
vmware-fusion
levenshtein-distance
chronicle-map
outputcache
jide
xbmc
linter
jquery-ui-draggable
geotiff
twilio-click-to-call
carrot2
filenet
testrail
cubism.js
microstation
segment-io
myspace
adafruit
rspec2
android-wake-lock
turbo-prolog
nullable
sapi
flock
intel-c++
branch-and-bound
uvc
at-job
cosine-similarity
pseudo-class
contrast
raygun
trdion2011
kissfft
codeplex
jjaql
visual-studio-express
jammer
dtmf
observium
cardreader
sqlclr
sentestingkit
listitem
subproject
josql
usertype
cross-database
google-maps-mobile
flex-mobile
u2netdk
drawtobitmap
silent
globals
eclipse-marketplace
scrollbars
sifr
feasibility
perl5.12

Resources

Encrypt Message