Is it possible to do string substitution in Android resource XML files directly?

前端 未结 4 2069
误落风尘
误落风尘 2021-01-04 20:03

In my android app, I have a large string resource xml file. I want to make reference and reuse declared resources values within String values. Is it possible to have the R

4条回答
  •  盖世英雄少女心
    2021-01-04 20:51

    It's indeed possible.

    
    
      
    ]>
    
    
        &appname;
        The &appname; app was created by &author;
    
    

    You can even define your entity globaly e.g:

    res/raw/entities.ent:

      
      
    

    res/values/string.xml:

    
    
        %ents;   
    ]>
    
    
        &appname;
        The &appname; app was created by &author;
    
    

提交回复
热议问题