EventBus的使用详解,功能为在Fragment,Activity,Service,线程之间传递消息

最近跟同事用到了EventBus的使用,之前不太了解EventBus,查阅资料发现EventBus还挺好用的,用法比较简单,下面就把我看到的关于EventBus的博客分享给大家,里面介绍了很多的使用详情,讲述的比较全面,可以分享给大家

http://blog.csdn.net/harvic880925/article/details/40660137

但是在使用之前记得在build.gradle(Moduel:app)中配置一下,

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(':core')
    compile project(':material')
    compile project(':weight')
    compile project(':files')
    compile project(':http')
    compile files('libs/jxmpp-core-0.4.1.jar')
    compile files('libs/jxmpp-util-cache-0.4.2.jar')
    compile files('libs/smack-android-4.1.7.jar')
    compile files('libs/smack-android-extensions-4.1.7.jar')
    compile files('libs/smack-core-4.1.7.jar')
    compile files('libs/smack-extensions-4.1.7.jar')
    compile files('libs/smack-im-4.1.7.jar')
    compile files('libs/smack-sasl-provided-4.1.7.jar')
    compile files('libs/smack-tcp-4.1.7.jar')
    compile files('libs/dom4j-1.6.1.jar')
    compile 'com.alibaba:fastjson:1.2.8'
    compile 'com.j256.ormlite:ormlite-android:4.48'
    compile 'com.jph.takephoto:takephoto_library:2.0.4'
    compile 'com.github.gcacace:signature-pad:1.0.3'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'de.greenrobot:eventbus:3.0.0-beta1'
    compile 'com.contrarywind:Android-PickerView:3.2.4'
    testCompile 'junit:junit:4.12'
}
原文地址:https://www.cnblogs.com/wangying222/p/7009740.html