I have a class that has this structure:
public class MyClass {
private double myDouble;
private MyObject myObject;
public myMethod() {
AnotherObject anotherObject = new AnotherObject();
anotherObject.getInfo(new Callback<String>() {
@Override
public void success(MyObject myObject) {
this.myObject = myObject; // this is what I would like to do
}
// and a method for the failure case
});
}
}
Essentially, I am looking for a way to save the value of myObject
that I get from the success
method inside the instance variable myObject
(this.myObject
). Currently, with the above code, I get a "Cannot resolve symbol 'myObject'" message.
Is this possible?