
android
lynn_chen
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
why don't we often use inner class in android development?
every new inner class takes up an extra 1KB of memory.原创 2012-06-12 11:49:44 · 471 阅读 · 0 评论 -
Handler,Looper,Message
1. Handler在创建实例时,会关联一个Looper对象,这个Looper对象是它对应线程的变量拷贝 - ThreadLocal变量的一员,当它sendMessage()的时候,会将Message.taget设置自身Handler对象并加入到Looper的MessageQueue中,等待消息循环。2. Looper管理了一个MessageQueue,线程的run()方法中会调用Loop原创 2012-10-25 01:48:02 · 690 阅读 · 0 评论 -
ContentProvider和ContentResolver
ContentProvider向其他程序提供data.ContentResolver自动查找注册在系统中的ContentProvider,by authority。Activity 通过 ContentResolver 在URI的抽象层面上操作数据,而ContentResolver又在其内部的调用IContentProvider provider = acquireProv原创 2012-07-03 01:04:03 · 587 阅读 · 0 评论 -
startActivityForResult using the tab Activity 的解决办法
tab activity 中调用startActivityForResult 以获取子activity的运行结果时,会有一个问题,那就是 onActivityResult 方法无法被回调。这通常发生在ActivityGroup中,(我估计的,未研究源码)其原因在于 从 tab activity 进入 子activity时,ActivityGroup进入了活动栈,而不是tab activit翻译 2012-09-13 21:58:36 · 2676 阅读 · 0 评论 -
TextView 设置 Ellipsize 属性,但它不工作?
I have a listView with custom objects defined by the xml-layout below. I want the textView with id "info" to be ellipsized on a single line, and I've tried using the attributesandroid:singleLine="转载 2012-08-24 22:47:20 · 5173 阅读 · 0 评论 -
Handler 的运行过程和作用
过程:Handler发送Message(关联此Handler)到主线程的消息队列,当运行到此消息时,它将回调关联的Handler的handleMessage方法,此方法运行在主线程上。作用:1. 在主线程上,执行(或延迟执行)周期的任务,无需使用计时器或闹钟管理器。例如:public class CycleHandler extends Handler { @Ove原创 2012-08-26 18:01:28 · 810 阅读 · 0 评论 -
Unable to add window is not valid; is your activity running?
错误:android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@435def20 is not valid; is your activity running? at android.view.V转载 2012-08-16 23:20:46 · 915 阅读 · 0 评论 -
How to close Android application?
Android has a mechanism in place to close an application safely per its documentation. In the last Activity that is exited (usually the main Activity that first came up when the application started) j转载 2012-08-09 22:35:43 · 1160 阅读 · 0 评论 -
speeding up app in android
1. View.onDraw( ) method is a very performance-criticalpiece of code, so it’s best to do as little as possible there.• If possible, avoid doing any object allocations in the method onDraw( ).• P原创 2012-06-19 15:29:49 · 515 阅读 · 0 评论 -
60FPS is the target
I recommend that you make every effort to reach a consistent rate of 60FPS. That corresponds to the maximum refresh rate of most LCD displays and is also the speed used on popular gaming platforms suc转载 2012-07-04 18:09:28 · 878 阅读 · 0 评论 -
onDraw() and invalidate()
1. invalidate()定义脏的区域,而这两个区域会在未来的某个点上被刷新,及调用ondraw()。2. ondraw方法虽然全部都会执行,但在界面上只刷新 脏 的区域。3. 例如:onKeyDown()的每一次运行都会触发界面的刷新。原创 2012-06-16 15:47:13 · 891 阅读 · 0 评论 -
proguard混淆的简单总结
proguard混淆器运行的过程(其他的过程暂不讨论):通过在命令行中运行proguard脚本并使用直接加参数和调用proguard.cfg来实现,而eclipse adt在发布releaseapk时执行这一过程,它完成的大部分工作,他包括injars,outjars,libraryjars(自动添加工程libs中的jar的路径)的参数指定,并且通过jdk/tools/proguard/pro原创 2012-12-01 21:42:29 · 2165 阅读 · 0 评论