Connectionlistener

I am trying to send massages from a connectiq app to an Android app. I used transmit like this:

Communications.transmit(interventionID, null,new TascCommListener());

and I have this class for ConnectionListener:

class TascCommListener extends Comm.ConnectionListener

{

    static var SUCCESS = 0;

    static var FAILURE = 1;

    hidden var mCallback;

    function onComplete() {

        mCallback.invoke(SUCCESS);

    }

    function onError() {

        mCallback.invoke(FAILURE);

    }

My app isn't working after I added these lines, I haven't any error but I have one warning : 

WARNING: 

Class 'TascCommListener' does not initialize its super class, 'ConnectionListener'

I am newbie. What should I do to handle the situation?

  • Unlike some other object-oriented languages, a derived class in Monkey C doesn't implicitly initialize its super class.

    The warning indicates that you have to do this explicitly. Add the following function to your class:

    function initialize() {
      Comm.ConnectionListener.initialize();
    }

    (I feel like it's a bug that there's no documentation for ConnectionListener.initialize().)

    While this may or may not resolve your actual problem, it will resolve the warning for sure.

  • Thanks a lot. It does solve the warning.

    But my connetIQ app stops working from the page that I add the transmit part. Is there any other line that I should add? I just need to send data from the watch to the Android app, not vice versa.