다음을 통해 공유


SearchResult.MatchInfo.SnippetFormatted Property

Definition

Gets the snippet corresponding to the given entry.

public Java.Lang.ICharSequence SnippetFormatted { [Android.Runtime.Register("getSnippet", "()Ljava/lang/CharSequence;", "", ApiSince=31)] get; }
[<get: Android.Runtime.Register("getSnippet", "()Ljava/lang/CharSequence;", "", ApiSince=31)>]
member this.SnippetFormatted : Java.Lang.ICharSequence

Property Value

Attributes

Remarks

Gets the snippet corresponding to the given entry.

Snippet - Provides a subset of the content to display. Only populated when requested maxSnippetSize > 0. The size of this content can be changed by SearchSpec.Builder#setMaxSnippetSize. Windowing is centered around the middle of the matched token with content on either side clipped to token boundaries.

Class example 1: this returns "foo. Another".

Class example 2: for the first MatchInfo, this returns "Test Name" and, for the second MatchInfo, this returns "Testing 1 2 3".

Java documentation for android.app.appsearch.SearchResult.MatchInfo.getSnippet().

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.

Applies to