【Android】AndroidStudio关于EventBus报错解决方法its super classes have no public methods with the @Subscribe
来源:互联网 发布:神舟笔记本超频软件 编辑:程序博客网 时间:2024/06/01 07:37
作者:程序员小冰,GitHub主页:https://github.com/QQ986945193
新浪微博:http://weibo.com/mcxiaobing
首先说明,以前我用eventBus的jar包写得项目demo,前几天就写了一个EventBus的实例,这次我没用jar包,直接用gradle引用的,可是demo写完了,报错:
its super classes have no public methods with the @Subscribe annotation
所以就用google搜索了一下,找到了解决方法,那就是在接受者
onEvent()方法添加注解: @Subscribe 然后问题解决,如:
/** * * 从发布者那里得到eventbus传送过来的数据 * * 加上@Subscribe以防报错:its super classes have no public methods with the @Subscribe annotation * * @param event */ @Subscribe public void onEvent(String event){ tv.setText(event); }
效果图如下:
eventBus简单使用实例demo需要的可以直接去下载:
(AndroidStudio版)github下载地址:
https://github.com/QQ986945193/DavidEventBusDemo
(AndroidStudio版)git开源中国下载地址:
http://git.oschina.net/MCXIAOBING/DavidEventBusDemo
(AndroidStudio版)CSDN免积分下载地址:
http://download.csdn.net/detail/qq_21376985/9623446
1 1
- AndroidStudio关于EventBus报错解决方法its super classes have no public methods with the @Subscribe
- 【Android】AndroidStudio关于EventBus报错解决方法its super classes have no public methods with the @Subscribe
- 关于eventbus报错its super classes have no public methods with the @Subscribe的问题
- EventBus报错:and its super classes have no public methods with the @Subscribe annotation
- 使用EventBus框架报异常:its super classes have no public methods with the @Subscribe annotation
- EventBus3.0报错..its super classes have no public methods with the @Subscribe annotation
- Eventbus注册异常:its super classes have no public methods with the @Subscribe annotation
- 异常 EventBusException:its super classes have no public methods with the @Subscribe annotation
- 异常 EventBusException:its super classes have no public methods with the @Subscribe annotation
- MainActivity and its super classes have no public methods with the @Subscribe annotation
- Subscriber class xxx.xxx.xxx and its super classes have no public methods with the@Subscribe annotat
- Subscriber class xxx.xxx.xxx and its super classes have no public methods with the@Subscribe annotat
- EventBusException: Subscriber class *** and its super classes have no public methods with the @Subsc
- EventBusException: Subscriber class *** and its super classes have no public methods with the @Subsc
- EventBusException: Subscriber class *** and its super classes have no public methods with the @Subsc
- EventBus 注册错误no public methods with the @Subscribe annotation
- Subscriber class .NewsFragment and its super classes have no public methods
- 关于Android报错:error: Error: No resource found that matches the given name (at 'label' with value)
- 升级CDH到5.7.0
- Android 性能优化工具
- java 获取系统信息
- 分布式事务解决方案(三)
- ijkplayer在android下的编译
- 【Android】AndroidStudio关于EventBus报错解决方法its super classes have no public methods with the @Subscribe
- android binder
- extjs 自定义事件
- Java程序员的基本语法知识面试题
- MapReduce作业运行流程
- iOS开发之OCR光学识别储蓄卡以及信用卡
- 在windows下无法打开openssl,无法安装wechat扩展
- 数据保存在Sd卡,并且账号密码信息保存
- 妙味课堂中使用php,MySQL,ajax制作简易的新浪微博页面