Cannot make a static reference to the non-static method

后端 未结 7 2116
长发绾君心
长发绾君心 2020-11-21 04:32

Building a multi-language application in Java. Getting an error when inserting String value from R.string resource XML file:

public static final         


        
7条回答
  •  隐瞒了意图╮
    2020-11-21 04:55

    You can either make your variable non static

    public final String TTT =  (String) getText(R.string.TTT);
    

    or make the "getText" method static (if at all possible)

提交回复
热议问题