Flutter Engine
The Flutter Engine
FlutterActivityEvents.java
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5package io.flutter.app;
6
7import android.content.ComponentCallbacks2;
8import android.content.Intent;
9import android.os.Bundle;
10import io.flutter.plugin.common.PluginRegistry.ActivityResultListener;
11import io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener;
12
13/**
14 * A collection of Android {@code Activity} methods that are relevant to the core operation of
15 * Flutter applications.
16 *
17 * <p>Application authors that use an activity other than {@link FlutterActivity} should forward all
18 * events herein from their activity to an instance of {@link FlutterActivityDelegate} in order to
19 * wire the activity up to the Flutter framework. This forwarding is already provided in {@code
20 * FlutterActivity}.
21 */
22public interface FlutterActivityEvents
23 extends ComponentCallbacks2, ActivityResultListener, RequestPermissionsResultListener {
24 /**
25 * @param savedInstanceState If the activity is being re-initialized after previously being shut
26 * down then this Bundle contains the data it most recently supplied in {@code
27 * onSaveInstanceState(Bundle)}.
28 * @see android.app.Activity#onCreate(android.os.Bundle)
29 */
30 void onCreate(Bundle savedInstanceState);
31
32 /**
33 * @param intent The new intent that was started for the activity.
34 * @see android.app.Activity#onNewIntent(Intent)
35 */
36 void onNewIntent(Intent intent);
37
38 /** @see android.app.Activity#onPause() */
39 void onPause();
40
41 /** @see android.app.Activity#onStart() */
42 void onStart();
43
44 /** @see android.app.Activity#onResume() */
45 void onResume();
46
47 /** @see android.app.Activity#onPostResume() */
49
50 /** @see android.app.Activity#onDestroy() */
51 void onDestroy();
52
53 /** @see android.app.Activity#onStop() */
54 void onStop();
55
56 /**
57 * Invoked when the activity has detected the user's press of the back key.
58 *
59 * @return {@code true} if the listener handled the event; {@code false} to let the activity
60 * continue with its default back button handling.
61 * @see android.app.Activity#onBackPressed()
62 */
63 boolean onBackPressed();
64
65 /** @see android.app.Activity#onUserLeaveHint() */
67
68 /**
69 * @param hasFocus True if the current activity window has focus.
70 * @see android.app.Activity#onWindowFocusChanged(boolean)
71 */
72 void onWindowFocusChanged(boolean hasFocus);
73}
void onWindowFocusChanged(boolean hasFocus)
void onCreate(Bundle savedInstanceState)