上一页 1 2 3 4 5 6 ··· 13 下一页
摘要: 1.方法不要写太长,如果太长,抽取其中的逻辑到新的方法中 bad good 2.函数只做一件事 如果做了多件事,要在方法名里体现出来 3.每个函数一个抽象层级 4.函数名可以长一些,比长注释好 5.方法参数不要有bool值 6.方法参数大于两个,考虑把其中的参数封装为对象 阅读全文
posted @ 2016-08-08 15:47 BaronZ 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 1.命名要有意义 错误写法 正确写法 2.某些构造函数可以提供有意义的静态方法去实现 阅读全文
posted @ 2016-08-08 15:21 BaronZ 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1.区别 The followings are two limitations of SurfaceView: You can not be animated, transformed and scaled; You can not overlay two SurfaceView. TextureV 阅读全文
posted @ 2016-08-06 15:54 BaronZ 阅读(449) 评论(0) 推荐(0) 编辑
摘要: 1. view as text 阅读全文
posted @ 2016-07-28 16:20 BaronZ 阅读(125) 评论(0) 推荐(0) 编辑
摘要: adb shellsups //这里找到自己app对应的pidkill -3 pid//退出shell 模式adb pull /data/anr/traces.txt f:\log 阅读全文
posted @ 2015-12-16 15:25 BaronZ 阅读(974) 评论(0) 推荐(0) 编辑
摘要: AndroidStudio导入项目一直卡在Building gradle project info,实际上是因为你导入的这个项目使用的gradle与你已经拥有的gradle版本不一致,导致需要下载该项目需要的gradle版本,不知是被墙了还是什么原因,反正就是会一直卡住,直至下载完成(如果能下载完成... 阅读全文
posted @ 2015-09-27 23:44 BaronZ 阅读(19611) 评论(0) 推荐(0) 编辑
摘要: 1.subscribeOn()//网络数据库io,图像cpu 2.Observable.concat(ob1, ob2, ob3)会把三个ob返回的结果合并 3.Observable.concat(ob1, ob2, ob3).takeFirst(//return boolean) //takeFi 阅读全文
posted @ 2015-08-20 17:46 BaronZ 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 5.Handler内存泄露 在一个Activity里面,如果没有静态地创建一个Handler,有可能导致内存泄露。 因为Hander和Looper绑定,如果looper的MessageQueue有消息没处理完,则Looper还引用着Handler,而Handler引用着Activity,导致Ac... 阅读全文
posted @ 2015-08-17 09:34 BaronZ 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 7.查看依赖 6.buildToolsVersion build tools版本号 compileSdkVersion android sdk版本 5.删除无用资源 4.定义资源类型变量(可以在代码中R.string.ResName调用) 3.在build.gradle里面定义常量,在Android 阅读全文
posted @ 2015-07-30 15:24 BaronZ 阅读(774) 评论(0) 推荐(0) 编辑
摘要: 前言你们从Eclipse转到Android Studio的时候,是不是会怀念Eclipse的方法注释模版?敲/**加回车,模板就出来了,而Android Studio却不能自定义(或者我没有找到)现在我找到替代方法了,就是用live templates步骤1.File->Setting->Edito... 阅读全文
posted @ 2015-07-22 17:24 BaronZ 阅读(23555) 评论(1) 推荐(4) 编辑
上一页 1 2 3 4 5 6 ··· 13 下一页