• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
5 package io.flutter.app;
6 
7 import android.app.Activity;
8 import android.app.Application;
9 import android.support.annotation.CallSuper;
10 
11 import io.flutter.view.FlutterMain;
12 
13 /**
14  * Flutter implementation of {@link android.app.Application}, managing
15  * application-level global initializations.
16  */
17 public class FlutterApplication extends Application {
18     @Override
19     @CallSuper
onCreate()20     public void onCreate() {
21         super.onCreate();
22         FlutterMain.startInitialization(this);
23     }
24 
25     private Activity mCurrentActivity = null;
getCurrentActivity()26     public Activity getCurrentActivity() {
27         return mCurrentActivity;
28     }
setCurrentActivity(Activity mCurrentActivity)29     public void setCurrentActivity(Activity mCurrentActivity) {
30         this.mCurrentActivity = mCurrentActivity;
31     }
32 }
33