空指针异常的原因
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();
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();
相关文章推荐
- 网站大全
- 宁波金鸟服饰有限公司举行公司化运作第一阶段总结表彰大会
- 数据存储操作(1)-------- SharedPreference存储
- 博弈问题及SG函数(真的很经典)
- 6.原型模式
- shell学习第四天----华丽的printf输出
- JavaWeb学习02-03
- C# 里面的 #region 含义
- SDUT 1197----约瑟夫问题
- 多路数组聚集(Multiway)
- 系统吞吐量(TPS)、用户并发量、性能测试概念和公式
- 设计类图
- Java获取图像Exif信息
- postgresql 初始
- 【下班后学Android】Android开发环境搭建
- 数据库SQL优化大总结之 百万级数据库优化方案
- Populating Next Right Pointers in Each Node I, II
- 关于scanf 函数,你很少了解的“秘密”
- 06-3. 单词长度(15)
- 网络抖动