code: public static String getResourceString(Context context, String key) {
      int id = getIdentifier(context, "string", key);
      if (id != 0) {
        return context.getResources().getString(id);
      } else {
        return null;
      }
    }
docs: Get the string resource for the given key. Returns null if not found.