I am trying to implement SearchView
in my android app to open an Activity
and perform a search task in that activity. For some reason, the activity that SearchView
opens gets paused after starting, causing it's onCreate
method to be called twice which in turn performs the search twice. Obviously not optimal since this means hitting the backend twice for every request.
I can't figure out why this is happening, so I start to belive this is intended behavior. Can anyone provide a small know working example project that uses SearchView
? I looked everywhere for a working example to see if this is indeed the intended behavior, but I had no luck.
Thanks in advance!