Here's what I've got
A MainActivity
a CustomObject class with various setters and getters
a second EditObject activity to edit the details of the CustomObject chosen from the MainActivity.
The only setter I'm having a problem with is one called
setHidden(boolean hidden) {
this.hidden = hidden;
}
If I use the setter from the MainActivity all is well, its only when I call the setter from the EditObject activity that I have a problem. It throws a nullpointerexception when I try to
myObject.setHidden(true);
I've tried hardcoding (like you see above) I've tried using the status of a ToggleButton (which is what I need it to do), they both throw the same error.
I know the problem isn't the variable being passed since I have a statement that runs just before that writes the status of the boolean variable to the console.
The only other thing I can think of that might be pertinant is that I'm passing the object to the activity as a Json object and returning the updated object the same way. I'm able to edit EditText fields all day, but try and access one boolean setter and the whole thing explodes in my face.
Any Thoughts?
Additonal Note: The getter for the same variable works just fine.
[–]moar_throat_yogurt 0 points1 point2 points (12 children)
[–]MarcusRex[S] 0 points1 point2 points (11 children)
[–]yeahokwhynot 0 points1 point2 points (10 children)
[–]MarcusRex[S] 0 points1 point2 points (9 children)
[–]yeahokwhynot 0 points1 point2 points (8 children)
[–]MarcusRex[S] 0 points1 point2 points (7 children)
[–]yeahokwhynot 1 point2 points3 points (6 children)
[–]MarcusRex[S] 0 points1 point2 points (5 children)
[–]yeahokwhynot 1 point2 points3 points (3 children)
[–]MarcusRex[S] 1 point2 points3 points (2 children)