title: Flutter: cannot find symbol MethodCallHandler
body: <p>I'm trying to get my Flutter app to receive data from other apps via iOS/Android sharing dialogs. Basically I want to be able to receive http links.
  While there are a couple of plugins that allow to share from Flutter, I can't seem to find anything when it comes to receiving data (at least not cross-platform).
  I've been working through this <a href="https://flutter.io/docs/get-started/flutter-for/android-devs#how-do-i-handle-incoming-intents-from-external-applications-in-flutter" rel="nofollow noreferrer">example</a> from the official Flutter documentation, but it doesn't work.
  MainActivity.java throws the exception "cannot find symbol MethodCallHandler".</p>
  
  <pre><code>MainActivity.java:
  
  package com.example.flutterlink;
  
  import android.content.Intent;
  import android.os.Bundle;
  
  import java.nio.ByteBuffer;
  
  import io.flutter.app.FlutterActivity;
  import io.flutter.plugin.common.ActivityLifecycleListener;
  import io.flutter.plugin.common.MethodCall;
  import io.flutter.plugin.common.MethodChannel;
  import io.flutter.plugins.GeneratedPluginRegistrant;
  
  public class MainActivity extends FlutterActivity {
  
    private String sharedText;
  
    @Override
    protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      GeneratedPluginRegistrant.registerWith(this);
      Intent intent = getIntent();
      String action = intent.getAction();
      String type = intent.getType();
  
      if (Intent.ACTION_SEND.equals(action) &amp;&amp; type != null) {
        if ("text/plain".equals(type)) {
          handleSendText(intent); // Handle text being sent
        }
      }
  
      new MethodChannel(getFlutterView(), "app.channel.shared.data").setMethodCallHandler(
              new MethodCallHandler() {
                @Override
                public void onMethodCall(MethodCall call, MethodChannel.Result result) {
                  if (call.method.contentEquals("getSharedText")) {
                    result.success(sharedText);
                    sharedText = null;
                  }
                }
              });
    }
  
    void handleSendText(Intent intent) {
      sharedText = intent.getStringExtra(Intent.EXTRA_TEXT);
    }
  }
  </code></pre>
  
  <p>Any hints?</p>