issues with reading battery state

I tried to follow the instructions on the android documentation but I am receiving an "Must Override a Superclass method" error on the Override above public void success.  I have the env sensor.
public void getBattery()
{
try{
settingModule = mwBoard.getModule(Settings.class);
} catch (UnsupportedModuleException e){
Log.i("MainActivity", String.format("getBattery unsupported module"));
return;
}

settingModule.routeData().fromBattery().stream("battery_state").commit().onComplete(new AsyncOperation.CompletionHandler<Timer.Controller>()
{
@Override
public void success(RouteManager result)
{
result.subscribe("battery_state", new RouteManager.MessageHandler() {
@Override
public void process(Message message) {
Log.i("MainActivity", "Battery state: " + message.getData(BatteryState.class));
}
});
}
});
settingModule.readBatteryState();

}

Comments

  • edited April 2016
    Sorry, that was a typo in the in the code snippet and has been corrected.  The CompletionHandler generic should be RouteManager not Timer.Controller.

    AsyncOperation.CompletionHandler<RouteManager>
  • That fixed it.  Thank you!
This discussion has been closed.