Resource
ResolvableString backed by Android resource string with optional arguments. Arguments can be ResolvableStrings as well.
Should be explicitly subclassed to ensure stable persistence, and serialVersionUID
must be present. Example:
object InstallMessageTitle : ResolvableString.Resource() {
override fun stringId() = R.string.install_message_title
private const val serialVersionUID = -1310602635578779088L
private fun readResolve(): Any = InstallMessageTitle
}
class InstallMessage(fileName: String) : ResolvableString.Resource(fileName) {
override fun stringId() = R.string.install_message
private companion object {
private const val serialVersionUID = 4749568844072243110L
}
}
Content copied to clipboard
For transient strings, i.e. not persisted in storage, you can use ResolvableString.transientResource factory.
Parameters
args
string format arguments