An interface for classes that resolve a String based on a Context. This is useful to separate business logic from presentation, where a service or ViewModel can refer to a resource or other types of data that depend on the Locale or display without needing a Context to resolve its value.

There are two main types of string resolvers:

Accepting a StringResolver as a function argument implies that both the stable- and flow string resolvers are supported.



Link copied to clipboard
abstract fun get(context: Context): String

Resolves a String based on the given Context. The resulting value may differ per Context. E.g. due to differing locales.

Inherited functions

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)