Initialize boolean value “no such instance field”

血红的双手。 提交于 2019-12-12 18:15:40

问题


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

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...
}

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

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


回答1:


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



来源:https://stackoverflow.com/questions/37002201/initialize-boolean-value-no-such-instance-field

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!