美文网首页
月笔记(2017-09)

月笔记(2017-09)

作者: 寒冬_腊月 | 来源:发表于2017-09-26 09:41 被阅读69次
  • 打印JsonObject所有的key和value

Iterator<?> keys = json_array.keys();

while( keys.hasNext() ) {
    String key = (String) keys.next();
    System.out.println("Key: " + key);//获取key
    System.out.println("Value: " + json_array.get(key));//获取value
}

  • Recyclerview 在加载的之前更改了头部的状态导致异常,stackoverflow
Cannot call this method in a scroll callback. Scroll callbacks mightbe run during a measure & layout pass where you cannot change theRecyclerView data. Any method call that might change the structureof the RecyclerView or the adapter contents should be postponed tothe next frame.
   java.lang.IllegalStateException:
       at android.support.v7.widget.RecyclerView.assertNotInLayoutOrScroll(RecyclerView.java:2581)
       at android.support.v7.widget.RecyclerView$RecyclerViewDataObserver.onItemRangeChanged(RecyclerView.java:4943)

解决办法:

recyclerView.post(new Runnable() {
        public void run() {
            articleAdapter.notifyItemInserted(allArticles.size() - 1);
        }
    });

  • Mint wapper图片放的位置
 /usr/share/backgrounds/ 
  • Android Studio 添加测试第三方库,打包release的时候又不能打包进去
    1. build.gradle添加如下方法
    debugCompile('com.facebook.stetho:stetho-okhttp3:1.4.2') {
         exclude group: 'com.android.support', module: 'appcompat-v7'
     }
    
    1. 在main的同级目录添加debug文件夹,目录结构和main的保持一直

相关文章

  • 月笔记(2017-09)

    打印JsonObject所有的key和value Recyclerview 在加载的之前更改了头部的状态导致异常,...

  • 闻道生活(周书-持续更新ing)

    2017-09我的周书 { 流血的仕途 }

  • 2017-09《灵魂破译师》.pdf 免费下载

    下载地址:2017-09《灵魂破译师》[www.rejoiceblog.com].pdf

  • 2017-09

    少女的情话:“会在一起的人,终会在一起。就像地球是圆的,无论怎么背道而驰还是会重新相遇。时光在跌跌撞撞里蹉跎很多年...

  • 2017-09

    09.05 高温,养生操、肩颈、滚背。 09.04 高温,养生操、肩颈、欣欣向荣。 09.03 继续高温,窝在室内...

  • CentOS 7.5安装部署Jewel版本Ceph集群

    参考文档 https://www.linuxidc.com/Linux/2017-09/146760.htmhtt...

  • Python迭代器与生成器是什么鬼?

    很棒的文章: https://www.linuxidc.com/Linux/2017-09/147206.htm ...

  • linux 的 postman

    https://huajiakeji.com/web-development/2017-09/60.html[ht...

  • 随笔 | 2017-09

    本篇收集作者 2017 年 09 月期间的一些或成熟的或不成熟的想法。字数约 3100 字;阅读时间约 7 分钟。...

  • 2017-09~04

    前几天的三位老师给大家讲的是心里还有就是思路,还有我们。你那个售前售中售后这一方面滴。然后我今天主要给大家讲一下就...

网友评论

      本文标题:月笔记(2017-09)

      本文链接:https://www.haomeiwen.com/subject/cpacsxtx.html