随笔分类 -  Android

安卓应用开发
Android代码的几点小技巧
摘要:1)View的状态保存与恢复dispatchRestoreInstanceStateonRestoreInstanceStateonSaveInstanceState2)Service的前台服务使用startForeground(NOTIFICATION_ID, mNotification)stop 阅读全文
posted @ 2017-05-26 11:47 虫子CCC 阅读(234) 评论(0) 推荐(0)
关于矢量图片资源向后兼容:CompatVectorFromResourcesEnabled标志的使用
摘要:StackOverflow上摘抄的: some things have changed since I asked this question so I will answer it myself.With Support Library 23.4.0 the support for VectorD 阅读全文
posted @ 2017-05-26 11:44 虫子CCC 阅读(4207) 评论(0) 推荐(0)
指定Android Studio编译工程时的源文件编码
摘要:统一设置为UTF8编码在工程的根目录下的build.gradle文件中,添加定义。tasks. withType(JavaCompile) { options.encoding = "UTF-8"} 如图: 阅读全文
posted @ 2017-05-26 11:35 虫子CCC 阅读(381) 评论(0) 推荐(0)
安卓日历同步的一些要点
摘要:1)API接口 android.content.ContentProvider android.content.ContentResolver android.provider.CalendarContract 另外,在创建日历账号时(向系统的Calendars表插入一条数据)需要设置为适配器模式, 阅读全文
posted @ 2017-05-26 11:23 虫子CCC 阅读(1350) 评论(0) 推荐(0)
Android Studio编译错误:Unexpected lock protocol found in lock file. Expected 3, found 0.
摘要:如果不小心手动修改了.gradle文件夹中的内容,那么再打开之前编译成功的工程时,会出现类似下面的错误: Gradle app neame project refresh failed: Unexpected lock protocol found in lock file. Expected 3, 阅读全文
posted @ 2017-05-26 10:42 虫子CCC 阅读(9540) 评论(1) 推荐(1)