Get Android predefined string -


i'm tying predefined android strings (from android sdk):

i can strings like: android.r.string.ok , android.r.string.cancel.
cannot android.r.string.activity_resolver_use_always , android.r.string.activity_resolver_use_once
getting error 'cannot resolve symbol' in android studio though can see strings id's in android.r file.

using: context.getstring(android.r.string.activity_resolver_use_always)

is there other way strings?

that's answer:

int resid = getresources().getidentifier("activity_resolver_use_once", "string", "android"); final string = getstring(resid); 

Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -