共 7 篇文章 |
|
我一直以为ap1会监听list1的变化,重新初始化list1,然后执行相应的更新,现在才知道不对,ap1监听的是new String[]{"listView1 item"}的变化。相当与切断了list1与原始数据源(new String[]{"listView1 item"})的关系,因此之后调用notifyDataSetChanged并不会起作用,因为list1 和inner_list1已经是存在于堆上的完全不... 阅174 转0 评0 公众公开 16-01-08 12:54 |
[大赞]The final local variable xxx cannot be assigned, since it is defined in an enclosing type.出错信息:The final local variable xxx cannot be assigned, since it is defined in an enclosing type“,其中xxx是一个局部变量名。解决的办法:将xxx 作一下封装,用集合或者数组,如果xxx是基本数据类型一般用数组。然后在接下来用到... 阅676 转0 评0 公众公开 16-01-05 10:38 |
Parcel: unable to marshal value在两个activity直接传递List<xxInfo>时,出现Parcel: unable to marshal value异常。在MainActivity页面(MainActivity页面向NextActivity页面传递一个List<xxInfo>): Intent intent = new Intent(this, NextActivity.class); intent.putExtra("list", list); startActivity(intent); ... 阅65 转0 评0 公众公开 15-12-25 16:09 |
空指针ll_status.setLayoutParams(params);上面代码报空指针,ll_status还是params空指针?答案是:ll_status.LayoutParams params = ll_status.getLayoutParams();ll_status.getLayoutParams();上面代码报空指针,谁空指针?答案是:ll_status.总结:调用方法的对象空指针还是方法参数空指针?答案是:调用方法的对象空指针。 阅22 转0 评0 公众公开 15-11-25 17:05 |
Resources$NotFoundException: String resource10-25 15:06:13.325: E/AndroidRuntime(13159): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x9010-25 15:06:13.325: E/AndroidRuntime(13159): at android.content.res.出错原因是TextView test = (TextView) findViewById(R.id.test); test.se... 阅32 转0 评0 公众公开 15-11-25 15:10 |