Trying to use <!ENTITY in ANDROID resources with error: “The entity was referenced, but not declared.”
问题 I'm following this solution to use enetities in my string resource file: Is it possible to do string substitution in Android resource XML files directly? I'm using an external file in the resource tree: /res/raw/entities.dtd , its content: <!ENTITY ent_devicename "MyDeviceName"> In the string.xml resource file: <!DOCTYPE resources [ <!ENTITY % ent_devicename SYSTEM "../raw/entities.dtd"> %ent_devicename; ]> <resources> <string name="name">The name is &ent_devicename;</string> </resources> but