Querying resource values using LocalContext.current

18 hours ago 2
ARTICLE AD BOX

I am doing this -

val context = LocalContext.current val credentialManager = CredentialManager.create(context) Button( onClick = { CoroutineScope(Dispatchers.IO).launch { try { val accounts = AccountManager.get(context).accounts Log.d("Accounts", accounts.joinToString { it.name }) val interactiveRequest = GetCredentialRequest.Builder() .addCredentialOption( GetGoogleIdOption.Builder() .setServerClientId(context.getString(R.string.default_web_client_id)) .setFilterByAuthorizedAccounts(false) .setAutoSelectEnabled(false) .build() ) .build() } catch (ex: Exception) { Log.e("SignIn", "Interactive sign-in failed", ex) } } } )

but this line -

context.getString(R.string.default_web_client_id)

is having a red underline. hovering over it says - Querying resource values using LocalContext.current

But this do not cause any issue in my app. Can I somehow resolve this?

Read Entire Article