Search code examples
androidandroid-annotationsotto

Otto. Avoid @Produce validation warnimg message


Android Otto library gives below warning message when @Produce method is used. How to avoid the message?

Note: Validating elements
C:\Users\Me\GroupViewActivity_.java:90: warning: Element ProduceHandler unvalidated by 
public GroupViewEvent produceGroup() {
                      ^
C:\Users\Me\GroupInfoFragment_.java:111: warning: Element SubscribeHandler unvalidated by 
public void onUpdateGroup(final GroupViewEvent event) {

I use otto in order to communicate between Fragment and Activity. The activity (in above, GroupViewActivity.java) has @Produce method and child Fragment has @Subscribe so that it receives updates.

In addition, I'm using Otto+AndroidAnnotation with following guide: https://github.com/excilys/androidannotations/wiki/OttoIntegration


Solution

  • As @WonderCsabo mentioned, it works great in current release of AndroidAnnotations(v3.2) and otto(v1.3.6). Do not have to use otto-2.0.0-SNAPSHOT version.