初始化布尔值“没有这样的实例字段". [英] Initialize boolean value "no such instance field"

查看:318
本文介绍了初始化布尔值“没有这样的实例字段".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在调试时遇到错误,无法设置此布尔值.我附上了错误的屏幕截图.

I get an error in debugging and I can't set this boolean value. I attached a screenshot of the error.

我在mainActivity中这样调用DeviceUpdateManager:

I call DeviceUpdateManager in my mainActivity like this:

public class MainActivity extends AppCompatActivity implements DeviceUpdateManager.OnDataCOM {
    DeviceUpdateManager deviceUpdateManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.deviceUpdateManager = new    DeviceUpdateManager(this.serverCOM,this.getApplicationContext(),this);
    }
etc...
}

我找不到错误...与另一个类中传递的Context有关吗?

I cannot find the error... Is it related to the passing Context in another class?

已解决 我重新启动了PC,然后重新启动了Android Studio,一切正常.

SOLVED I reboot the PC and restarted Android Studio and everything worked great.

推荐答案

在代码中更改变量名称并在代码中使用旧名称运行应用程序时,就会发生这种情况.

It happens when you changed variable name in code and running application with older name in code.

这篇关于初始化布尔值“没有这样的实例字段".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆