- 博客(50)
- 资源 (8)
- 收藏
- 关注
原创 RecyclerView相关
http://mp.weixin.qq.com/s/CzrKotyupXbYY6EY2HP_dA http://blog.youkuaiyun.com/qq_23012315/article/details/50807224 http://blog.youkuaiyun.com/qq_23012315/article/details/51096696
2018-01-07 21:41:37
247
原创 ListView使用和优化措施
1. 基本使用直接代码:list_view_item.xmlLinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" andr
2017-12-29 18:41:02
291
原创 Android分辨率
1. Android中px、dp、sp详解1.1. 名称解释px(pixel): 即像素,1px代表屏幕上的一个物理的像素点。但px单位不被建议使用。由于分辨率不同,同样像素大小的图片在不同手机显示的实际大小可能不同。要用到px的情况是需要画1像素表格线或阴影线的时候,如果用其他单位画则会显得模糊。dp(device independent pixel): dp是最常用也是最难理解的尺寸单位。与像素
2017-12-27 18:37:01
576
原创 ActionProvider
ActionProviderAndroid Customer ActionProvider使用ActionProvider可以实现option menu的功能,类似微信右上角的图标点击后的效果,这篇文章有详细的描述自定义ActionProvider ToolBar 自定义Menu小红点可以实现消息数量显示的功能,右侧Menu添加角标(Toolbar ActionBar Menu添加小红点),这篇文章
2017-07-15 16:42:09
655
转载 【Java基础之五】Java中IO详解
Java IO简介Java IO使用场景12 按是否格式化输出分13 按是否要缓冲分14 按数据格式分15 按输入输出分16 特殊需要Java IO分类Java IO举例1 文件2 字节流21 输入流InputStream22 输出流OutputStream23 输入输出流DataInputStreamDataOutputStream24 PushbackInputStre
2017-03-18 12:10:06
761
转载 【Java基础之四】Java集合类
1. Java集合类基本概念在编程中,常常需要集中存放多个数据。从传统意义上讲,数组是我们的一个很好的选择,前提是我们事先已经明确知道我们将要保存的对象的数量。一旦在数组初始化时指定了这个数组长度,这个数组长度就是不可变的,如果我们需要保存一个可以动态增长的数据(在编译时无法确定具体的数量),Java的集合类就是一个很好的设计方案了。集合类主要负责保存、盛装其他数据,因此集合类也被称为容器类。所有的
2016-12-20 15:14:47
399
原创 【Java基础之三】Java序列化
一序列化简介二序列化简单例子三序列化算法四影响序列化因素1 transient关键字2 writeObject方法与readObject方法3 Externalizable接口五单例模式序列化-readResolve六参考文献一、序列化简介序列化是一种对象持久化的手段。普遍应用在网络传输、RMI(Remote Method Invocation)等场景中。Java提供了一种对象序列
2016-12-18 16:58:40
363
转载 【C++基础之四】c++ char in short long double占字节数
和机器字长及编译器有关系:所以,int,long int,short int的宽度都可能随编译器而异。但有几条铁定的原则(ANSI/ISO制订的): 1 sizeof(short int)<=sizeof(int) 2 sizeof(int)<=sizeof(long int) 3 short int至少应为16位(2字节) 4 long int至少应为32位。 unsigned 是
2016-10-06 11:28:28
1446
转载 Android 之Activity启动模式之 lauchMode
Android 之Activity启动模式(一)之 lauchModeAndroid 之Activity启动模式(二)之 Intent的Flag属性Android 之Activity启动模式(三)之 启动模式的其它属性
2016-03-06 15:49:32
466
转载 Android中Scroller的应用
Android中View绘制流程以及invalidate()等相关方法分析Android中滑屏实现----手把手教你如何实现触摸滑屏以及Scroller类详解Scroller的应用--滑屏实现Android 带你从源码的角度解析Scroller的滚动实现原理Android学习Scroller(五)——详解Scroller调用过程以及View的重绘
2016-02-25 17:46:07
306
转载 Android Fragment 真正的完全解析
Android项目Tab类型主界面大总结 Fragment+TabPageIndicator+ViewPagerAndroid Fragment 真正的完全解析(上)
2016-02-20 17:57:15
291
转载 Android中onSharedPreferenceChangeListener类
onSharedPreferenceChangeListener类
2016-02-18 18:05:13
430
原创 Android中onSaveInstanceState注意事项
1.在一个activity被销毁前,不一定会调用onSaveInstanceState()这个方法,因为不是所有情况都需要去存储activity的状态(例如当用户按回退键退出你的activity的时候,因为用户指定关掉这个activity)。2.如果这个方法被调用,它一定会在 onStop()方法之前,可能会在onPause()方法之前。3.布局中的每一个View默认实现了onSa
2016-02-17 17:34:39
1885
原创 Android强制横屏或竖屏注意事项
经过Android5.1测试:一个Activity如果在onReusume里没有特别声明,或没在AndroidManifest.xml配置成横屏或竖屏,在旋转时其声明周期为:onCreate——onStart—onResume—屏幕旋转—-onPause(是去焦点)—-onStop(彻底看不见)—onDestory,然后重新onCreate—onStart—-onResume,即又走了一遍。02-1
2016-02-17 16:13:55
6275
转载 【C++基础之三】拷贝构造函数详解
参考以下文章:http://blog.youkuaiyun.com/lwbeyond/article/details/6202256
2015-11-11 15:18:38
264
原创 【C++基础之二】常量指针和指针常量
参看以下文章:http://www.cnblogs.com/witty/archive/2012/04/06/2435311.htmlhttp://blog.youkuaiyun.com/jackystudio/article/details/11519817
2015-11-11 11:20:12
305
转载 【JAVA面试题】之二:Java RandomAccessFile用法
《JAVA面试宝典》中6.3提到了RandomAccessFile,顺便看了下,摘抄如下:文章: http://blog.youkuaiyun.com/akon_vm/article/details/7429245 说明RandomAccessFile的绝大多数功能,但不是全部,已经被JDK 1.4 RandomAccessFile可以用在断点续传功能上。文章:http:/
2015-09-26 19:40:41
487
转载 【JAVA面试题】之一:第几行的obj符合垃圾收集器的收集标准?
《JAVA程序员面试宝典》86页,一道选择题,不太明白答案,望指教,题目是这样的:下列代码中,第几行的obj符合垃圾收集器的收集标准?1.Object aobj = new Object();2.Object bobj = new Object();3.Object cobj = new Object();4.aobj = bobj;5.aobj = cobj;6.cobj
2015-09-22 22:30:54
1935
转载 【Java基础之一】Java Classloader机制解析
文章1举例说明了Classloader的加载顺序以及反射的应用等。文章2说明:loadClass方法:没有被标记为final,也就意味着我们是可以override这个方法的,也就是说双亲委托机制是可以打破的。findClass方法:在写自己的ClassLoader的时候,如果想遵循双亲委托机制,则只需要override findClass。假如我们自己写了一
2015-09-19 14:09:58
292
转载 【Java多线程】之十四:Java FutureTask Example Program
Sometime back I wrote a post about Java Callable Future interfaces that we can use to get the concurrent processing benefits of threads as well as they are capable of returning value to the calling pro
2015-08-09 19:29:27
406
转载 【Java多线程】之十三:Java Callable Future Example
In last few posts, we learned a lot about java threads but sometimes we wish that a thread could return some value that we can use. Java 5 introduced java.util.concurrent.Callable interface in concurre
2015-08-09 19:01:45
318
转载 【Java多线程】之十二:Java Thread Pool Example using Executors and ThreadPoolExecutor
A thread pool manages the pool of worker threads, it contains a queue that keeps tasks waiting to get executed.A thread pool manages the collection of Runnable threads and worker threads execute Runnab
2015-08-09 18:37:59
287
转载 【Java多线程】之十一:Java BlockingQueue Example implementing Producer Consumer Problem
java.util.concurrent.BlockingQueue is a Queue that supports operations that wait for the queue to become non-empty when retrieving and removing an element, and wait for space to become available in the
2015-08-09 17:14:59
370
转载 【Java多线程】之十:Timer and TimerTask
When we create a Thread in java, by default it’s a user thread and if it’s running JVM will not terminate the program. When a thread is marked as daemon thread, JVM doesn’t wait it to finish and as soo
2015-08-09 16:36:14
400
转载 【Java多线程】之九:守护线程
When we create a Thread in java, by default it’s a user thread and if it’s running JVM will not terminate the program. When a thread is marked as daemon thread, JVM doesn’t wait it to finish and as soo
2015-08-09 13:01:30
348
转载 【Java多线程】之八:单例模式的线程安全
Singleton is one of the most widely used creational design pattern to restrict the object creation by applications. In real world applications, resources like Database connections or Enterprise Informa
2015-08-09 12:32:13
390
转载 【Java多线程】之七:死锁例子
Deadlock is a programming situation where two or more threads are blocked forever, this situation arises with at least two threads and two or more resources. Here I have written a simple program that w
2015-08-09 12:03:17
388
转载 【Java多线程】之六:Synchronization and Thread Safety
Java provide multi-threaded environment support using Java Threads, we know that multiple threads created from same Object share object variables and this can lead to data inconsistency when the thread
2015-08-09 11:49:10
553
转载 【Java多线程】之五:wait, notify and notifyAll
The Object class in java contains three final methods that allows threads to communicate about the lock status of a resource. These methods are wait(), notify() and notifyAll().The current thread which
2015-08-09 10:47:14
658
转载 【Java多线程】之四:Life Cycle of Thread
Understanding Life Cycle of Thread and Thread States are very important when you are working with Threads and programming for multi-threaded environment.As we learned in last tutorial, we can create a
2015-08-09 10:13:25
896
转载 【Java多线程】之三:Java Thread Join Example
Java Thread join method can be used to pause the current thread execution until unless the specified thread is dead. There are three overloaded join functions.public final void join(): This method puts
2015-08-09 10:05:40
481
转载 【Java多线程】之二:Java Thread Sleep Example
java.lang.Thread sleep() method can be used to pause the execution of current thread for specified time in milliseconds. The argument value for milliseconds can’t be negative, else it throws IllegalArg
2015-08-09 09:53:14
380
转载 【Java多线程】之一:Thread Simple Example
Processes and Threads are two basic units of execution. Java concurrency programming is more concerned with threads.ProcessA process is a self contained execution environment and it can be seen as a pr
2015-08-08 22:59:27
521
原创 Android新手不能错过的AsyncTask例子
Android AsyncTask 源码解析解析可以参考这篇文章,写得很透彻。AsyncTask的缺陷,在3.0以前,最大支持128个线程的并发,10个任务的等待。 在3.0以后,无论有多少任务,都会在其内部单线程执行;参照写了一个例子,用AsyncTask下载一个图片,并显示出来,下载过程中显示百分比。 新手一定要看,一看就会,一看就懂。部分源码来至于网络,点击下载源码。我在4.0.3中运行成
2015-08-08 12:37:29
401
Android安卓AIDL进程间通信Service简单例子
2015-08-22
Android中Broadcastreceiver两种注册方式
2015-08-11
JAVA中使用Thread类和Runnable接口创建多线程
2015-08-08
Android新手不能错过的AsyncTask例子
2015-08-08
Android官方activity-lifecycle生命周期例子
2015-07-19
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人