/**
		 * Assuming this activity was started with a new intent, process the incoming information and
		 * react accordingly.
		 * @param intent
		 */
		void HandleIntent (Intent intent)
		{
			// Special processing of the incoming intent only occurs if the if the action specified
			// by the intent is ACTION_SEARCH.
			if (Intent.ActionSearch.Equals (intent.Action)) {

				// SearchManager.QUERY is the key that a SearchManager will use to send a query string
				// to an Activity.
				String query = intent.GetStringExtra (SearchManager.Query);

				// We need to create a bundle containing the query string to send along to the
				// LoaderManager, which will be handling querying the database and returning results.
				Bundle bundle = new Bundle();
				bundle.PutString (QUERY_KEY, query);

				ContactablesLoaderCallbacks loaderCallbacks = new ContactablesLoaderCallbacks (this);

				// Start the loader with the new query, and an object that will handle all callbacks.
				LoaderManager.RestartLoader (CONTACT_QUERY_LOADER, bundle, loaderCallbacks);
			}
		}
示例#2
0
        /**
         * Assuming this activity was started with a new intent, process the incoming information and
         * react accordingly.
         * @param intent
         */
        void HandleIntent(Intent intent)
        {
            // Special processing of the incoming intent only occurs if the if the action specified
            // by the intent is ACTION_SEARCH.
            if (Intent.ActionSearch.Equals(intent.Action))
            {
                // SearchManager.QUERY is the key that a SearchManager will use to send a query string
                // to an Activity.
                String query = intent.GetStringExtra(SearchManager.Query);

                // We need to create a bundle containing the query string to send along to the
                // LoaderManager, which will be handling querying the database and returning results.
                Bundle bundle = new Bundle();
                bundle.PutString(QUERY_KEY, query);

                ContactablesLoaderCallbacks loaderCallbacks = new ContactablesLoaderCallbacks(this);

                // Start the loader with the new query, and an object that will handle all callbacks.
                LoaderManager.RestartLoader(CONTACT_QUERY_LOADER, bundle, loaderCallbacks);
            }
        }