我正在为Android编写具有多个级别的游戏。 Mian Activity包含许多带有级别名称和玩家得分计数器的按钮。
每个按钮都是扩展View的CustomButton类的实例。 我将新按钮添加到Mian Activity中,如下所示:
CustomButton Level_1 = new CustomButton (this, "Level 1", level_1_score, flexboxlayout);
我有两个问题。
public static final String APP_PREFERENCES_LEVEL_SCORE = " level_1_score";