2017年3月14日

懒汉模式

摘要: 一、懒汉式 (1)线程不安全 最简单的实现方式,大多数书籍上表述方式 代码通俗易懂,使用了懒加载模式,但是这段代码存在致命的问题,当有多个线程并行调用getInstance()的时候,就会创建多个实例。换句话说,在多线程下是不能正常使用的。 (2)线程安全 虽然做到了线程安全,并且解决了多实例的问题 阅读全文

posted @ 2017-03-14 13:50 不二家的瓶子 阅读(1094) 评论(0) 推荐(0) 编辑

CountDownTimer

摘要: Schedule a countdown until a time in the future, with regular notifications on intervals along the way. Example of showing a 30 second countdown in a 阅读全文

posted @ 2017-03-14 10:36 不二家的瓶子 阅读(151) 评论(0) 推荐(0) 编辑

导航