last day (15 days later) » 

8:07 PM
0
Q: Button click causing null pointer

Ebad SagharEvery time I click on the button, the app crashes. I have trouble finding the bug, but I'm sure it has to do something with either the onClickListener, or the onClick function. Note: I'm using Parse API for some back end stuff. But I highly doubt it has anything to do with any of the Parse stuf...

 
I double clicked on that and it took me to those lines involving those lines. However, the fields are not null as I put in something, but still get the same errors.
Edit has been made to show line 40
 
Then can you just put ---------- Log.i(TAG, mUserName == null ? "mUserName is null" : mUserName.getText() == null ? "mUserName.getText() is null" : "nothing is null"); -------------- at line 39?
 
@uDevel I made the edit.
@KalelWade, please see the post now after the edit.
 
Did the log even appear before the exception? What line is 43 now?
 
@KalelWade, apologies. I only added uDevel's log. I'll add yours now.
Line 43 goes back to the .toString().getText()
 
8:07 PM
Then can you post the log before the exception where my code run?
 
It's not logging it anything at all.
@uDevel, I posted the log before the .toString().getText() lines.
 
LOL, this doesn't even make sense, did you hide information log or something? You know what? Change it to Log.e just in case Log.i is hidden.
 
I just took a screen shot. Please see the edit.
 
This is very weird. It should at least log something for line 42. Restart the IDE. Step through the code line by line, and stop before running the line 43 and show Log. I am sorry, I might sound stupid, but it just doesn't make sense to not showing the Log.
 
@uDevel, IDE has been restarted numerous of times before posting this question. I even restarted my laptop twice. Let me step through.
 
8:07 PM
Make sure you didn't filter out the log too.
 
I did notice this little message: "The JAR file has no source attachment"
The message was from the View$onClickListener class
 
Well, that's normal if you didn't attach source to it. It doesn't cause this error.
I can't post code here. Continue the talk in Answer.
 
I made the if statement
still, it doesn't work , instead nothing happens, it doesn't crash anymore though
so I'm still wondering why it's not working
 

last day (15 days later) »