android studio 使用心得

Only the original thread that created a view hierarchy can touch its views.

    出现这种情况的原因是在子线程中调用了主线程的UI组件




Your Project contains error(s), please fix them before running your application.


    drawable目录下的图片不能使用数字和大写字母命名,否则就出现这种错误。




解决Exception raised during rendering: com/android/util/PropertiesMap (Details)


    在android studio中无法预览布局时候,尝试更改版本即可。google后是2.1版本后出现的问题。




Exception raised during rendering: com/android/util/PropertiesMap

    缺少部分关键词,检查代码。 是layout_weight 不是weight



drawable下图片过大

    java.lang.OutOfMemoryError:
        Failed to allocate a 23970828 byte allocation with 2097152 free bytes and 2MB until OOM

      解决方法
        android:hardwareAccelerated="false"
        android:largeHeap="true"



数组(array)索引(index)越界(outofbounds)异常(exception)

     Caused by: java.lang.ArrayIndexOutOfBoundsException: length=9; index=9

        例如:
            private String data[][]={{"1","  11"},{"2","  22"},
                {"3","  33"},{"3","  44"},{"5","  55"},
                {"6","  66"},{"7","  77"},{"8","  88"},{"9","  99"}};
                /*省略若干*/
            for (int i=0;i<=this.data.length;i++){
                Map<String,String> map=new HashMap<String, String>();
                map.put("name_id",data[i][0]);
                map.put("name",data[i][1]);
                this.list.add(map);
            }
        该例子中出现 “=”  导致数组索引越界 去掉“=”则ok。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值