Aracılığıyla paylaş


SearchRecentSuggestionsProvider Class

Definition

This superclass can be used to create a simple search suggestions provider for your application.

[Android.Runtime.Register("android/content/SearchRecentSuggestionsProvider", DoNotGenerateAcw=true)]
public class SearchRecentSuggestionsProvider : Android.Content.ContentProvider
[<Android.Runtime.Register("android/content/SearchRecentSuggestionsProvider", DoNotGenerateAcw=true)>]
type SearchRecentSuggestionsProvider = class
    inherit ContentProvider
Inheritance
SearchRecentSuggestionsProvider
Attributes

Remarks

This superclass can be used to create a simple search suggestions provider for your application. It creates suggestions (as the user types) based on recent queries and/or recent views.

In order to use this class, you must do the following.

<ul> <li>Implement and test query search, as described in android.app.SearchManager. (This provider will send any suggested queries via the standard android.content.Intent#ACTION_SEARCH ACTION_SEARCH Intent, which you'll already support once you have implemented and tested basic searchability.)</li> <li>Create a Content Provider within your application by extending android.content.SearchRecentSuggestionsProvider. The class you create will be very simple - typically, it will have only a constructor. But the constructor has a very important responsibility: When it calls #setupSuggestions(String, int), it configures the provider to match the requirements of your searchable activity.</li> <li>Create a manifest entry describing your provider. Typically this would be as simple as adding the following lines:

&lt;!-- Content provider for search suggestions --&gt;
                &lt;provider android:name="YourSuggestionProviderClass"
                          android:authorities="your.suggestion.authority" /&gt;

</li> <li>Please note that you do not instantiate this content provider directly from within your code. This is done automatically by the system Content Resolver, when the search dialog looks for suggestions.</li> <li>In order for the Content Resolver to do this, you must update your searchable activity's XML configuration file with information about your content provider. The following additions are usually sufficient:

android:searchSuggestAuthority="your.suggestion.authority"
                android:searchSuggestSelection=" ? "

</li> <li>In your searchable activities, capture any user-generated queries and record them for future searches by calling android.provider.SearchRecentSuggestions#saveRecentQuery SearchRecentSuggestions.saveRecentQuery().</li> </ul>

<div class="special reference"> <h3>Developer Guides</h3>

For information about using search suggestions in your application, read the Search developer guide.

</div>

Java documentation for android.content.SearchRecentSuggestionsProvider.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

SearchRecentSuggestionsProvider()
SearchRecentSuggestionsProvider(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

CallingAttributionSource

Gets the attribution source of the calling app.

(Inherited from ContentProvider)
CallingAttributionTag

Return the attribution tag of the caller that initiated the request being processed on the current thread.

(Inherited from ContentProvider)
CallingPackage

Return the package name of the caller that initiated the request being processed on the current thread.

(Inherited from ContentProvider)
CallingPackageUnchecked

Return the package name of the caller that initiated the request being processed on the current thread.

(Inherited from ContentProvider)
Class

Returns the runtime class of this Object.

(Inherited from Object)
Context

Retrieves the Context this provider is running in.

(Inherited from ContentProvider)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsTemporary

Returns true if this instance is a temporary content provider.

(Inherited from ContentProvider)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ReadPermission
Obsolete.

Return the name of the permission required for read-only access to this content provider. -or- Change the permission required to read data from the content provider.

(Inherited from ContentProvider)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

WritePermission
Obsolete.

Return the name of the permission required for read/write access to this content provider. -or- Change the permission required to read and write data in the content provider.

(Inherited from ContentProvider)

Methods

ApplyBatch(IList<ContentProviderOperation>)

Override this to handle requests to perform a batch of operations, or the default implementation will iterate over the operations and call ContentProviderOperation#apply on each of them.

(Inherited from ContentProvider)
ApplyBatch(String, IList<ContentProviderOperation>)

Override this to handle requests to perform a batch of operations, or the default implementation will iterate over the operations and call ContentProviderOperation#apply on each of them.

(Inherited from ContentProvider)
AttachInfo(Context, ProviderInfo)

After being instantiated, this is called to tell the content provider about itself.

(Inherited from ContentProvider)
BulkInsert(Uri, ContentValues[])

Override this to handle requests to insert a set of new rows, or the default implementation will iterate over the values and call #insert on each of them.

(Inherited from ContentProvider)
Call(String, String, Bundle)

Call a provider-defined method.

(Inherited from ContentProvider)
Call(String, String, String, Bundle)

Call a provider-defined method.

(Inherited from ContentProvider)
Canonicalize(Uri)

Implement this to support canonicalization of URIs that refer to your content provider.

(Inherited from ContentProvider)
ClearCallingIdentity()

Reset the identity of the incoming IPC on the current thread.

(Inherited from ContentProvider)
Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Delete(Uri, Bundle)

Implement this to handle requests to delete one or more rows.

(Inherited from ContentProvider)
Delete(Uri, String, String[])

This method is provided for use by the ContentResolver.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Dump(FileDescriptor, PrintWriter, String[])

Print the Provider's state into the given stream.

(Inherited from ContentProvider)
DumpAsync(FileDescriptor, PrintWriter, String[]) (Inherited from ContentProvider)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetPathPermissions()

Return the path-based permissions required for read and/or write access to this content provider.

(Inherited from ContentProvider)
GetStreamTypes(Uri, String)

Called by a client to determine the types of data streams that this content provider supports for the given URI.

(Inherited from ContentProvider)
GetType(Uri)

This method is provided for use by the ContentResolver.

GetTypeAnonymous(Uri)

Implement this to handle requests for MIME type of URIs, that does not need to reveal any internal information which should be protected by any permission.

(Inherited from ContentProvider)
Insert(Uri, ContentValues, Bundle)

Implement this to handle requests to insert a new row.

(Inherited from ContentProvider)
Insert(Uri, ContentValues)

This method is provided for use by the ContentResolver.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
OnCallingPackageChanged()

Called whenever the value of #getCallingPackage() changes, giving the provider an opportunity to invalidate any security related caching it may be performing.

(Inherited from ContentProvider)
OnConfigurationChanged(Configuration)

To be added This method is always called on the application main thread, and must not perform lengthy operations.

(Inherited from ContentProvider)
OnCreate()

This method is provided for use by the ContentResolver.

OnLowMemory()

To be added This method is always called on the application main thread, and must not perform lengthy operations.

(Inherited from ContentProvider)
OnTrimMemory(TrimMemory)

Called when the operating system has determined that it is a good time for a process to trim unneeded memory from its process.

(Inherited from ContentProvider)
OpenAssetFile(Uri, String, CancellationSignal)

This is like #openFile, but can be implemented by providers that need to be able to return sub-sections of files, often assets inside of their .

(Inherited from ContentProvider)
OpenAssetFile(Uri, String)

This is like #openFile, but can be implemented by providers that need to be able to return sub-sections of files, often assets inside of their .

(Inherited from ContentProvider)
OpenFile(Uri, String, CancellationSignal)

Override this to handle requests to open a file blob.

(Inherited from ContentProvider)
OpenFile(Uri, String)

Override this to handle requests to open a file blob.

(Inherited from ContentProvider)
OpenFileHelper(Uri, String)

Convenience for subclasses that wish to implement #openFile by looking up a column named "_data" at the given URI.

(Inherited from ContentProvider)
OpenPipeHelper(Uri, String, Bundle, Object, ContentProvider+IPipeDataWriter)

A helper function for implementing #openTypedAssetFile, for creating a data pipe and background thread allowing you to stream generated data back to the client.

(Inherited from ContentProvider)
OpenTypedAssetFile(Uri, String, Bundle, CancellationSignal)

Called by a client to open a read-only stream containing data of a particular MIME type.

(Inherited from ContentProvider)
OpenTypedAssetFile(Uri, String, Bundle)

Called by a client to open a read-only stream containing data of a particular MIME type.

(Inherited from ContentProvider)
Query(Uri, String[], Bundle, CancellationSignal)

Implement this to handle query requests where the arguments are packed into a Bundle.

(Inherited from ContentProvider)
Query(Uri, String[], String, String[], String, CancellationSignal)

Implement this to handle query requests from clients with support for cancellation.

(Inherited from ContentProvider)
Query(Uri, String[], String, String[], String)

This method is provided for use by the ContentResolver.

Refresh(Uri, Bundle, CancellationSignal)

Implement this to support refresh of content identified by uri.

(Inherited from ContentProvider)
RequireContext()

Retrieves a Non-Nullable Context this provider is running in, this is intended to be called after #onCreate.

(Inherited from ContentProvider)
RestoreCallingIdentity(ContentProvider+CallingIdentity)

Restore the identity of the incoming IPC on the current thread back to a previously identity that was returned by #clearCallingIdentity.

(Inherited from ContentProvider)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetPathPermissions(PathPermission[])

Change the path-based permission required to read and/or write data in the content provider.

(Inherited from ContentProvider)
SetReadPermission(String) (Inherited from ContentProvider)
SetupSuggestions(String, DatabaseMode)

In order to use this class, you must extend it, and call this setup function from your constructor.

SetWritePermission(String) (Inherited from ContentProvider)
Shutdown()

Implement this to shut down the ContentProvider instance.

(Inherited from ContentProvider)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
Uncanonicalize(Uri)

Remove canonicalization from canonical URIs previously returned by #canonicalize.

(Inherited from ContentProvider)
UnregisterFromRuntime() (Inherited from Object)
Update(Uri, ContentValues, Bundle)

Implement this to handle requests to update one or more rows.

(Inherited from ContentProvider)
Update(Uri, ContentValues, String, String[])

This method is provided for use by the ContentResolver.

Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to