From ee5a80a6afb148cb8357f7745b5f8a7d5dd9b12e Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 30 Nov 2016 09:49:43 -0800 Subject: [PATCH] Remove obsolete references to "flutter refresh" in hello_services (#7093) Fixes https://github.com/flutter/flutter/issues/6947 --- examples/hello_services/README.md | 20 ------------------- .../com/example/flutter/ExampleActivity.java | 14 ------------- 2 files changed, 34 deletions(-) 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 {