Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
FlutterApplication.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.app.Activity;
8import android.app.Application;
9import androidx.annotation.CallSuper;
10import io.flutter.FlutterInjector;
11
12/**
13 * Flutter implementation of {@link android.app.Application}, managing application-level global
14 * initializations.
15 *
16 * <p>Using this {@link android.app.Application} is not required when using APIs in the package
17 * {@code io.flutter.embedding.android} since they self-initialize on first use.
18 */
19public class FlutterApplication extends Application {
20 @Override
21 @CallSuper
22 public void onCreate() {
23 super.onCreate();
24 FlutterInjector.instance().flutterLoader().startInitialization(this);
25 }
26
27 private Activity mCurrentActivity = null;
28
29 public Activity getCurrentActivity() {
30 return mCurrentActivity;
31 }
32
33 public void setCurrentActivity(Activity mCurrentActivity) {
34 this.mCurrentActivity = mCurrentActivity;
35 }
36}
void setCurrentActivity(Activity mCurrentActivity)