0

I (think) I am receiving a NPE from this bit of code. I've been trying to figure out how to use the Eclipse Debugger, but I always get stuff like "Class File Editor not found."

Anyways here is an image of what the debugger says:

http://imageshack.us/photo/my-images/687/debuggingexception.png/

Code:

         private Handler handler = new Handler(){
    @Override
    public void handleMessage(Message msg){
        // dismiss the progress box
        pd.dismiss();
        BigDecimal bd = new BigDecimal(0);
        SearchActivity.this.parts.add(new Part("desc", "item id", bd));
        SearchActivity.this.parts.add(new Part("desc2", "item id2", bd));
        SearchActivity.this.parts.add(new Part("desc3", "item id3", bd));
        // create a new bundle
        Bundle b = new Bundle();

        // put the list into a parcel
        b.putParcelable("parts", parts);
        Intent i = new Intent(SearchActivity.this, Results.class);

        // put the bundle into the intent
        i.putExtras(b);
        startActivity(i);
    }
};
3
  • this is line 36: SearchActivity.this.parts.add(new Part("desc2", "item id2", bd)); Commented Jun 7, 2011 at 16:08
  • does anyone else think that SearchActivity.this is either redundant or suspicious? Commented Jun 7, 2011 at 16:11
  • Yeah, I thought that might be it - I'm changing it back to (parts) Commented Jun 7, 2011 at 16:14

1 Answer 1

2

Make sure the SearchActivity.this.parts list is non-null. That's the only thing I can see that would trigger an NPE on that line.

(It's definitely not new BigDecimal(5.5) anyhow.)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.