学习笔记
agaghd
Android开发
展开
-
【笔记】HTML标签汇总
本篇是HTML标签汇总,供查询用。原创 2017-12-14 10:46:03 · 352 阅读 · 0 评论 -
使用NotificationCompat.Builder创建通知和自定义通知
在早些的版本中,我们通常会new一个Notification,然后设置它的icon、when、flags等属性,最后用NotificationManager将其显示出来。现在对Notification直接设置属性的API已被Google标识为过时,更推荐使用NotificationCompact.Builder来构建一个通知。下边的代码是一个简单的通知示例: Notificati原创 2018-01-09 20:02:23 · 10266 阅读 · 0 评论 -
LintCode算法题:LRU Cache
什么是LRU百度和谷歌有相关的连接介绍,本文不赘述。 LRU_百度百科题目链接:LRU CacheDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) ...原创 2018-05-15 16:59:56 · 206 阅读 · 0 评论 -
实现RecyclerView上滑加载更多数据的方法
基本思路监听RecyclerView的上滑,获取最后一个可见的Item的Position,当其为最后一个Item时进行加载。 在onScrolled方法中获取最后一个可见的item的position 在onScrollStateChanged方法中进行判断:当newState为SCROLL_STATE_IDLE且最后一个可见的item的position为item总数-1时进行加载。 局部...原创 2018-05-23 16:10:45 · 1444 阅读 · 0 评论 -
LintCode算法题 1363. ZigZag Conversion
题目描述:The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) And then read lin...原创 2018-07-19 15:32:32 · 262 阅读 · 0 评论 -
Android单个DEX文件方法数不能超过65535的原因
随着项目规模的逐渐扩大,我们迟早会遇到单个方法数65535的问题。解决方法最常见的就是使用MultiDex,即分包的方法来解决问题。但是我们也有必要了解一下引起65535问题的原因。根据大佬在StackOverflow上的说法,你是可以在DEX文件中定义很多方法的,超过65535个也没有问题,但是虚拟机的方法调用指令(invoke-kind)只有16bits的可用空间,所以你只能调用2^16-...原创 2018-08-31 23:39:21 · 1109 阅读 · 0 评论 -
Lintcode155:非递归求二叉树的最小深度
题目Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.解题思路通过层序遍历二叉树的方式,记录层序遍历的层数,在第一次遇到左...原创 2018-12-12 21:24:58 · 386 阅读 · 0 评论