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

php - Embed BBCode within itself not working -

three.js - how to load gltf in three JS -

sql server - T-SQL: Access DB objects in same schema without qualifying? -