java - GreenRobot's eventbus can't see annotation, "no public methods" -


so, found out green robots' eventbus module. followed instructions on page try working: http://greenrobot.org/eventbus/documentation/how-to-get-started/

seems simple enough.

i put in appropriate code, when run on device crash:

org.greenrobot.eventbus.eventbusexception: subscriber class com.crowdlab.activities.loadingactivity , super classes have no public methods @subscribe annotation. 

the first few lines of class this:

public class loadingactivity extends baseactivity implements alertdialogbuttonlistener {     alertdialog mdialog = null;     alertdialog mpushdialog = null;      @subscribe     public void onmessageevent(messageevent event){         toast.maketext(this, "from loading "+event.message, toast.length_short).show();     }      @override     public void onstart() {         super.onstart();         eventbus.getdefault().register(this);     }      @override     public void onstop() {         eventbus.getdefault().unregister(this);         super.onstop();     }     .     .     . 

it /seems/ annotation there. compile happens without warning. i'm using version 3.0.0 specified in gradle file...

so wrong? (rtfm gratefully accepted, tell fm relevant article is.)

thanks!

-ken

doh! chose google's @subscribe rather green robot's.

import com.google.common.eventbus.subscribe; 

rather than

import org.greenrobot.eventbus.subscribe; 

the error should read "no method's implementing com.greenrobot.eventbus @subscribe annotation".


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -