Snowberg

 

2012年3月21日

关于Handler.post(Runnable runnable)的解释

摘要: http://stackoverflow.com/questions/5316393/handler-looper-implementation-in-androidhttp://developer.android.com/reference/android/os/Handler.html#post(java.lang.Runnable)Causes the Runnable r to be added to the message queue. The runnable will be run on the thread to which this handler is attached.这 阅读全文

posted @ 2012-03-21 21:42 Snowberg 阅读(1669) 评论(0) 推荐(0) 编辑

android:Handler

摘要: 一、Handler的定义: 主要接受子线程发送的数据, 并用此数据配合主线程更新UI. 解释: 当应用程序启动时,Android首先会开启一个主线程 (也就是UI线程) , 主线程为管理界面中的UI控件,进行事件分发, 比如说, 你要是点击一个 Button, Android会分发事件到Button上,来响应你的操作。如果此时需要一个耗时的操作,例如: 联网读取数据,或者读取本地较大的一个文件的时候,你不能把这些操作放在主线程中,如果你放在主线程中的话,界面会出现假死现象, 如果5秒钟还没有完成的话,会收到Android系统的一个错误提示"强制关闭".这个时候我们需要把这些 阅读全文

posted @ 2012-03-21 16:09 Snowberg 阅读(328) 评论(0) 推荐(0) 编辑

创建android逐帧动画的两种方式

摘要: 1.设置背景方式a.在res创建一个anim文件夹,该文件夹下创建animation_list.xml文件<?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="true" > <item android:drawable="@drawable/c1" andro 阅读全文

posted @ 2012-03-21 08:57 Snowberg 阅读(509) 评论(0) 推荐(0) 编辑

导航