开发者

Java: NullPointerException

开发者 https://www.devze.com 2023-03-10 20:36 出处:网络
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.\"

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);
    }
};


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.)

0

精彩评论

暂无评论...
验证码 换一张
取 消