Issue with page 165


So, I’m trying to set the text on my mDateButton via:


But my app keeps crashing when I run it. I took the mDateButton.setText(mCrime.getDate().toString()); out of my code, ran the app, and it launched fine, however, the mDateButton widget did not display any text (for obvious reason, because i commented out the setText.getDate().toString()); line.)

I’ve got my getters and setters set up fine in…for some reason, setText line keeps crashing my app. What gives?

[code] mDateButton = (Button)v.findViewById(;

	    mSolvedCheckBox = (CheckBox)v.findViewById(;
	    mSolvedCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
	        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
	            // Set the crime's solved property

Let me know if you need more code. Thanks in advance


Alright so I am narrowing it down. the issue has to do with calling the getDate().toString()); part.

I tried running the app with

and it ran fine. What’s the deal with the getDate().toString());

After reading the error stack trace, it looks like there is a null pointer error when calling getDate().toString()

it makes sense in theory, to receive a null pointer, because I haven’t set the date to anything in…



Haha, I figured it out.

didn’t write mDate = new Date();

in the ctor.

Wow, writing everything out on this forum really helped me narrow stuffs down though.

noms (: