Quick Search Cancel

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Quick Search Cancel

Postby hnager » Sat Jan 30, 2010 9:47 pm

I implemented search in my app using the SearchableDictionary example - everything works well, except I'd like my app to know when a user cancels out of a search by hitting the back button. I figured that onResume would be called, however that doesn't appear to be the case.

Any thoughts on how I can alert my app that the search was cancelled?
hnager
Freshman
Freshman
 
Posts: 5
Joined: Fri Jan 22, 2010 10:36 pm

Top

Postby hnager » Sat Jan 30, 2010 11:47 pm

I just found this yet havent implemented:

"Managing focus and knowing if search is active. The search UI is not a separate activity, and when the UI is invoked or dismissed, your activity will not typically be paused, resumed, or otherwise notified by the methods defined in Application Fundamentals: Activity Lifecycle. The search UI is handled in the same way as other system UI elements which may appear from time to time, such as notifications, screen locks, or other system alerts:

When the search UI appears, your activity will lose input focus.

When the search activity is dismissed, there are three possible outcomes:

If the user simply canceled the search UI, your activity will regain input focus and proceed as before. See setOnDismissListener(SearchManager.OnDismissListener) and setOnCancelListener(SearchManager.OnCancelListener) if you required direct notification of search dialog dismissals.
If the user launched a search, and this required switching to another activity to receive and process the search Intent, your activity will receive the normal sequence of activity pause or stop notifications.
If the user launched a search, and the current activity is the recipient of the search Intent, you will receive notification via the onNewIntent() method.
This list is provided in order to clarify the ways in which your activities will interact with the search UI."
hnager
Freshman
Freshman
 
Posts: 5
Joined: Fri Jan 22, 2010 10:36 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 12 guests