英文:
Using handler with onCreate() in Android
问题
我在onCreate()
方法中初始化了用于UI线程的处理程序(Handler),并使用此处理程序发布了新消息。
安卓系统将如何处理messagequeue
中的此代码?
是两条消息,一条用于onCreate()
方法,另一条用于runnable
处理程序,
还是onCreate()
方法中的每行代码都会成为messagequeue
中的一条消息?
我提出这个问题是因为我不理解onCreate()
方法如何与UI线程的messagequeue
一起工作。
英文:
I initiated Handler for the UI thread inside onCreate()
method and post new message using this handler.
How android system will handel this code inside messagequeue
Is it will be two messages one for onCreate()
method and another of runnable
handler
or each line code inside oncreate()
method will be message inside messagequeue
My question because I don't understand how oncreate()
mehtod work with UI thread messagequeue
专注分享java语言的经验与见解,让所有开发者获益!
评论