Files
engine/shell/platform/android/io/flutter/app/FlutterActivityEvents.java
T
Todd Volkert ec8cbe0fb6 Refactor FlutterActivity to be more composable (#3748)
This factors the functionality that was in `FlutterActivity`
to live in `FlutterActivityDelegate`. This will allow the creation of a
`FlutterFragmentActivity` that has the same core functionality, which in
turn unlocks certain Android plugins that choose to require the v4
support library (like Google Sign-In).

https://github.com/flutter/flutter/issues/10072
2017-06-07 12:28:41 -07:00

69 lines
2.0 KiB
Java

// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package io.flutter.app;
import android.content.ComponentCallbacks2;
import android.content.Intent;
import android.os.Bundle;
import io.flutter.plugin.common.PluginRegistry.ActivityResultListener;
import io.flutter.plugin.common.PluginRegistry.RequestPermissionResultListener;
/**
* A collection of Android {@code Activity} methods that are relevant to the
* core operation of Flutter applications.
* <p/>
* Application authors that use an activity other than {@link FlutterActivity}
* should forward all events herein from their activity to an instance of
* {@link FlutterActivityDelegate} in order to wire the activity up to the
* Flutter framework. This forwarding is already provided in
* {@code FlutterActivity}.
*/
public interface FlutterActivityEvents
extends ComponentCallbacks2, ActivityResultListener, RequestPermissionResultListener {
/**
* @see android.app.Activity#onCreate(android.os.Bundle)
*/
void onCreate(Bundle savedInstanceState);
/**
* @see android.app.Activity#onNewIntent(Intent)
*/
void onNewIntent(Intent intent);
/**
* @see android.app.Activity#onPause()
*/
void onPause();
/**
* @see android.app.Activity#onResume()
*/
void onResume();
/**
* @see android.app.Activity#onPostResume()
*/
void onPostResume();
/**
* @see android.app.Activity#onDestroy()
*/
void onDestroy();
/**
* Invoked when the activity has detected the user's press of the back key.
*
* @return {@code true} if the listener handled the event; {@code false}
* to let the activity continue with its default back button handling.
* @see android.app.Activity#onBackPressed()
*/
boolean onBackPressed();
/**
* @see android.app.Activity#onUserLeaveHint()
*/
void onUserLeaveHint();
}