title: Flutter EventChannel Confusion
body: <p>I am having a hard time connecting the dots on how to setup my EventChannel natively in Java and looking for some help.</p>
  <p>I am using MethodChannel to have flutter call directly into Native android code.  A couple of the methods of the MethodChannel will setup Listeners in my Java classes (data from bluetooth devices) and I would like to send the data back to the flutter/dart code over an EventChannel.   The event will be initiated from the java/android side and sent into the dart/flutter side.  I am not connecting the dots on how to &quot;push&quot; the event over to flutter.</p>
  <p>This is what I have done but it doesn't seem right.  How can I get my bluetooth event (deviceEvent method) to pass it's data to the EventChannel?</p>
  <p>Any help is much appreciated.</p>
  <p><strong>Class Declaration - Extended FlutterActivity</strong></p>
  <pre><code>public class MyCustomClass extends FlutterActivity implements FlutterPlugin, MethodCallHandler,  DeviceServiceListener {
  </code></pre>
  <p><strong>Overrode OnCreate:</strong></p>
  <pre><code>    @Override
  protected void onCreate(@Nullable final Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      BinaryMessenger binaryMessenger =getFlutterEngine().getDartExecutor().getBinaryMessenger();
      getContext().startActivity(
              FlutterActivity.createDefaultIntent(getApplicationContext())
      );
  
      eventChannel = new EventChannel(binaryMessenger, STREAM);
      streamHandler = new EventChannel.StreamHandler() {
          @Override
          public void onListen(Object arguments, EventChannel.EventSink events) {
              events.success(arguments);
          }
  
          @Override
          public void onCancel(Object arguments) {
              Log.e(&quot;platform_channel&quot;, &quot;arguments: &quot; + arguments.toString());
  
          }
      };
      eventChannel.setStreamHandler(streamHandler);
  }
  </code></pre>
  <p><strong>Device Event (data from bluetooth) - defined in the interface of DeviceServiceListener</strong></p>
  <pre><code> @Override
      public void deviceEvent(ListenerMessage message) {
  
          //I am not sure how to get my bluetooth data event into my flutter EventChannel
  
      }
  </code></pre>