问题
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