找回密码
 立即注册
线程AndroidThe使用 | android开发 2022-11-09 47 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
Android使用程序与传统的PC使用程序相同,都是消息驱动的。也就是说,在Android使用程序主线程中,一切函数都是在一个消息循环中履行的。Android使用程序其它线程,也可以像主线程相同,具有消息循环。Android使用程序主线程是一个特别的线程,由于它同时也是UI线程以及触摸屏、键盘等输入事情管理线程。主线程对消息循环很灵敏,一旦发作堵塞,就会影响UI的流通度,甚至发作ANR问题。这个PPT讲Android使用程序线程消息循环原理,首要涉及到Handler和Looper两个类,以及依据消息循环的不同使用场景,总结出三种线程使用模型。掌握Android使用程序消息管理机制,有助于我们熟练地使用同步和异步编程,提升程序的运行性能

(The Android application is the same as the traditional PC application, which is message driven. In other words, in the main thread of Android application, all functions are performed in a message loop. Android uses other threads of the program, which can also have a message loop like the main thread. The main thread of Android application is a special thread, because it is also the UI thread and the input event management thread such as touch screen and keyboard. The main thread is very sensitive to the message loop. Once it is blocked, it will affect the flow of the UI, and even cause an ANR problem. This PPT talks about the principle of message loop of Android application thread, mainly involving Handler and Looper, and summarizes three thread usage models according to different usage scenarios of message loop. Mastering the message management mechanism of Android application will help us skillfully use synchronous and asynchronous programming and improve the running performance of the program)

[下载]10382810668.rar




上一篇:Dalvik虚拟机
下一篇:Android应用程序UI架构