Gaugeview和首选项

时间:2014-03-29 14:15:15

标签: android user-interface

我在Android应用程序中使用了Gaugeview。 Here is Gaugeview

使用首选项我存储了Gaugeview使用的值,并且总是使用首选项我让用户更改一些海关缩放着色的值。如果我更改这些值并按回,则不会进行任何更改。我需要重新启动应用才能看到更改。我可以强制Gaugeview重绘自己而不重启应用程序吗?

1 个答案:

答案 0 :(得分:0)

解决! 我刚刚添加了一个名为“changed”的静态变量,将其设置为true,并写入了我的新onResume():

@Override
public void onResume(){
    super.onResume();
    if (changed == true) {
        this.recreate();
        changed=false;
        }
}