代码中易混单词的区分
Satus Vs State
state:
the mental, emotional or physical condition that a person or thing is in 状态;状况;情况(CONDITION OF SB/STH 状态)
- state倾向于condition,一般都是有限的、可列举的,「状态」的有效值之间可以类似状态迁移的用state,没有互相迁移的关系用status。
- state machine
- state transition diagram
- solid state
- in a state of
- steady state
status:
the situation at a particular time during a process (进展的)状况,情形
the social or professional position of sb/sth in relation to others 地位;身份;职位
- status则是不可确定的状态,statusText,一部分类似postion,status bar,status code
- present/current status
- running status
- system status
- exit status
handle vs handler
A handle is an abstract reference to a resource. Handle是对某个资源的抽象引用。
A handler is an asynchronous callback subroutine. Handler则是一个异步的回调函数(子程序)。
其他:Handler 封装了消息的发送,也负责接收消。内部会跟Looper关联。Looper 消息封装的载,内部包含了MessageQueue,负责从MessageQueue取出消息,然后交给Handler处理。MessageQueue 就是一个消息队列,负责存储消息,有消息过来就存储起来,Looper会循环的从MessageQueue读取消息。