![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
android高手进阶
JAVA服务端研发知识图谱
不忘初心 方得始终
展开
-
android findviewbyId 简化写法
在android开发中在oncreate的方法中经常要findViewById 来查找布局中的元素,这里我们可以简化写法如下: /** * 通过泛型来简化findViewById * * @param id * @param * @return */ protected final E getView(int id) {原创 2016-02-16 14:43:56 · 881 阅读 · 0 评论 -
android singleton 泛型模式的单例
public abstract class Singleton { private T mInstance; protected abstract T create(); public T get() { synchronized (this) { if (this.mInstance == null) { this.mInstance =原创 2016-03-09 10:15:18 · 800 阅读 · 0 评论