getStringFromAttr

fun Context.getStringFromAttr(attr: Int): String

Resolves a dynamic theme-dependent string resource ID from the specified theme attribute.

Return

The resolved String value, or an empty string if the attribute could not be resolved.

Parameters

attr

The theme attribute ID (e.g. R.attr.someString) to resolve.


fun Context.getStringFromAttr(attr: Int, vararg formatArgs: Any): String

Resolves a dynamic theme-dependent string resource ID from the specified theme attribute and formats it with the provided arguments.

Return

The formatted String value, or an empty string if the attribute could not be resolved.

Parameters

attr

The theme attribute ID (e.g. R.attr.someString) to resolve.

formatArgs

The formatting arguments to apply to the resolved string.