diff --git a/examples/hello_services/README.md b/examples/hello_services/README.md index 5beb9b3233..3bdd61856f 100644 --- a/examples/hello_services/README.md +++ b/examples/hello_services/README.md @@ -67,23 +67,3 @@ To build directly with `gradle`, use the following commands: To build with Android Studio, open the `android` folder in Android Studio and build the project as usual. - -### Updating the Dart code - -You can push new Dart code to a Flutter app during development without performing -a full rebuild of the Android app package. - -The `flutter refresh` tool manages this process. `flutter refresh` will build -a snapshot of an app's Dart code, copy it to an Android device, and send an -intent instructing the Android app to load the snapshot. - -To try this out: - - * Install and run the app on your device - * Edit the Dart code - * `flutter refresh --activity com.example.flutter/.ExampleActivity` - -`flutter refresh` sends an `ACTION_RUN` intent with an extra containing the -device filesystem path where the snapshot was copied. `ExampleActivity.java` -shows how an activity can handle this intent and load the new snapshot into -a FlutterView. diff --git a/examples/hello_services/android/app/src/main/java/com/example/flutter/ExampleActivity.java b/examples/hello_services/android/app/src/main/java/com/example/flutter/ExampleActivity.java index e3d64b0765..a7d627aa19 100644 --- a/examples/hello_services/android/app/src/main/java/com/example/flutter/ExampleActivity.java +++ b/examples/hello_services/android/app/src/main/java/com/example/flutter/ExampleActivity.java @@ -76,20 +76,6 @@ public class ExampleActivity extends Activity { flutterView.onPostResume(); } - @Override - protected void onNewIntent(Intent intent) { - // Reload the Flutter Dart code when the activity receives an intent - // from the "flutter refresh" command. - // This feature should only be enabled during development. Use the - // debuggable flag as an indicator that we are in development mode. - if ((getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) { - if (Intent.ACTION_RUN.equals(intent.getAction())) { - flutterView.runFromBundle(intent.getDataString(), - intent.getStringExtra("snapshot")); - } - } - } - private void sendGetRandom() { JSONObject message = new JSONObject(); try {