public void subscribe ( ArrayList < Long > tokens ) { if ( ws != null ) { if ( ws . isOpen ( ) ) { createTickerJsonObject ( tokens , mSubscribe ) ; ws . sendText ( createTickerJsonObject ( tokens , mSubscribe ) . toString ( ) ) ; subscribedTokens . addAll ( tokens ) ; for ( int i = 0 ; i < tokens . size ( ) ; i ++ ) { modeMap . put ( tokens . get ( i ) , modeQuote ) ; } } else { if ( onErrorListener != null ) { onErrorListener . onError ( new KiteException ( "ticker is not connected" , 504 ) ) ; } } } else { if ( onErrorListener != null ) { onErrorListener . onError ( new KiteException ( "ticker is null not connected" , 504 ) ) ; } } }
Subscribes for list of tokens .