# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
首先我们来看下单例模式的定义: 定义:在整个应用中,保证一个类只有一个实例,它提供了一个可以访问到它自己的全局访问点(静态方法)。 单例模式中有区分了懒汉式和饿汉式,懒汉式主要是用时间来换空间,饿汉式则是用空间来换时间。饿汉式是线程安全的,懒汉式是非线程安全的,如果要实现懒汉式的非线程安全,则可以再访问点添加synchronized关键字声明即可。在其他的一些项目中还使用了双重检测枷锁机制。 现在我们来看下代码,我会提供代码下载供大家参考。 文章详情:http://blog.csdn.net/michael_yy/article/details/7883621
资源推荐
资源详情
资源评论
收起资源包目录
singleton.zip (34个子文件)
singleton
AndroidManifest.xml 889B
res
layout
main.xml 444B
drawable-ldpi
ic_launcher.png 3KB
drawable-mdpi
ic_launcher.png 5KB
drawable-hdpi
ic_launcher.png 9KB
drawable-xhdpi
ic_launcher.png 14KB
values
strings.xml 184B
src
com
yangfuhai
singleton
SingletonActivity.java 1KB
HttpUtils.java 2KB
proguard-project.txt 781B
bin
classes
com
yangfuhai
singleton
BuildConfig.class 355B
SingletonActivity$1.class 1KB
SingletonActivity.class 1KB
R.class 566B
R$layout.class 409B
R$attr.class 355B
R$id.class 401B
R$string.class 442B
HttpUtils.class 3KB
SingletonActivity$1$1.class 1KB
R$drawable.class 422B
res
drawable-ldpi
ic_launcher.png 3KB
drawable-mdpi
ic_launcher.png 5KB
drawable-hdpi
ic_launcher.png 9KB
drawable-xhdpi
ic_launcher.png 14KB
jarlist.cache 119B
classes.dex 6KB
resources.ap_ 33KB
singleton.apk 38KB
.classpath 364B
assets
project.properties 562B
.project 845B
gen
com
yangfuhai
singleton
R.java 749B
BuildConfig.java 165B
共 34 条
- 1
资源评论
- 半毛钱_2013-09-26挺不错 解释和例子都详细
- meteor_an2012-11-19既有代码,又有说明,谢谢分享!
- Henry_droid2014-08-03谢谢分享,不错的demo
- Sophie_Dong2012-10-06这个真真不错,果断用之
- cenyuecai1232014-05-12还可以,易于理解
michael_yy
- 粉丝: 143
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功