EventBus使用詳解

一、概述 EventBus是一款針對Android優化的發佈/訂閱事件總線。主要功能是替代Intent,Handler,BroadCast在Fragment,Activity,Service,線程之間傳遞消息.優點是開銷小,代碼更優雅。以及將發送者和接收者解耦。 使用步驟: (1)自定義一個類,可以是空類,比如: 1. public class AnyEventType {   2.      p
相關文章
相關標籤/搜索