您的位置:首页 > 其它

空指针异常的原因

2015-06-07 22:46 239 查看
1,在hashmap中取不存在的键所对应的值

        TextView textTitle = (TextView)findViewById(R.id.post_name);

        textTitle.setText("公告");

        TextView postDetails = (TextView)findViewById(R.id.post_details);

        postDetails.setText(hashMap.get("newslist_title").toString());

        TextView postTime = (TextView)findViewById(R.id.post_time);

        postTime.setText(hashMap.get("newslist_time").toString());

        //postInflate = getLayoutInflater();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: