Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
io.flutter.app.FlutterActivity Class Reference
Inheritance diagram for io.flutter.app.FlutterActivity:
io.flutter.view.FlutterView.Provider io.flutter.plugin.common.PluginRegistry io.flutter.app.FlutterActivityDelegate.ViewFactory

Public Member Functions

FlutterView getFlutterView ()
 
FlutterView createFlutterView (Context context)
 
FlutterNativeView createFlutterNativeView ()
 
boolean retainFlutterNativeView ()
 
final boolean hasPlugin (String key)
 
final< T > T valuePublishedByPlugin (String pluginKey)
 
final Registrar registrarFor (String pluginKey)
 
void onBackPressed ()
 
void onRequestPermissionsResult (int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)
 
void onUserLeaveHint ()
 
void onWindowFocusChanged (boolean hasFocus)
 
void onTrimMemory (int level)
 
void onLowMemory ()
 
void onConfigurationChanged (Configuration newConfig)
 
FlutterView getFlutterView ()
 
- Public Member Functions inherited from io.flutter.plugin.common.PluginRegistry
Registrar registrarFor (@NonNull String pluginKey)
 
boolean hasPlugin (@NonNull String pluginKey)
 
< T > T valuePublishedByPlugin (@NonNull String pluginKey)
 
FlutterView createFlutterView (Context context)
 
FlutterNativeView createFlutterNativeView ()
 
boolean retainFlutterNativeView ()
 

Protected Member Functions

void onCreate (Bundle savedInstanceState)
 
void onStart ()
 
void onResume ()
 
void onDestroy ()
 
void onStop ()
 
void onPause ()
 
void onPostResume ()
 
void onActivityResult (int requestCode, int resultCode, Intent data)
 
void onNewIntent (Intent intent)
 

Detailed Description

Deprecated base class for activities that use Flutter.

Deprecated:
io.flutter.embedding.android.FlutterActivity is the new API that now replaces this class. See https://flutter.dev/go/android-project-migration for more migration details.

Definition at line 25 of file FlutterActivity.java.

Member Function Documentation

◆ createFlutterNativeView()

FlutterNativeView io.flutter.app.FlutterActivity.createFlutterNativeView ( )
inline

Hook for subclasses to customize the creation of the FlutterNativeView.

The default implementation returns null, which will cause the activity to use a newly instantiated native view object.

Implements io.flutter.app.FlutterActivityDelegate.ViewFactory.

Definition at line 64 of file FlutterActivity.java.

64 {
65 return null;
66 }

◆ createFlutterView()

FlutterView io.flutter.app.FlutterActivity.createFlutterView ( Context  context)
inline

Hook for subclasses to customize the creation of the FlutterView.

The default implementation returns null, which will cause the activity to use a newly instantiated full-screen view.

Implements io.flutter.app.FlutterActivityDelegate.ViewFactory.

Definition at line 53 of file FlutterActivity.java.

53 {
54 return null;
55 }

◆ getFlutterView()

FlutterView io.flutter.app.FlutterActivity.getFlutterView ( )
inline

Returns the Flutter view used by this activity; will be null before onCreate(Bundle) is called.

Implements io.flutter.view.FlutterView.Provider.

Definition at line 42 of file FlutterActivity.java.

42 {
43 return viewProvider.getFlutterView();
44 }

◆ hasPlugin()

final boolean io.flutter.app.FlutterActivity.hasPlugin ( String  key)
inline

Definition at line 74 of file FlutterActivity.java.

74 {
75 return pluginRegistry.hasPlugin(key);
76 }
boolean hasPlugin(@NonNull String pluginKey)

◆ onActivityResult()

void io.flutter.app.FlutterActivity.onActivityResult ( int  requestCode,
int  resultCode,
Intent  data 
)
inlineprotected

Definition at line 144 of file FlutterActivity.java.

144 {
145 if (!eventDelegate.onActivityResult(requestCode, resultCode, data)) {
146 super.onActivityResult(requestCode, resultCode, data);
147 }
148 }
boolean onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ onBackPressed()

void io.flutter.app.FlutterActivity.onBackPressed ( )
inline

Definition at line 113 of file FlutterActivity.java.

113 {
114 if (!eventDelegate.onBackPressed()) {
115 super.onBackPressed();
116 }
117 }

◆ onConfigurationChanged()

void io.flutter.app.FlutterActivity.onConfigurationChanged ( Configuration  newConfig)
inline

Definition at line 177 of file FlutterActivity.java.

177 {
178 super.onConfigurationChanged(newConfig);
179 eventDelegate.onConfigurationChanged(newConfig);
180 }

◆ onCreate()

void io.flutter.app.FlutterActivity.onCreate ( Bundle  savedInstanceState)
inlineprotected

Definition at line 89 of file FlutterActivity.java.

89 {
90 super.onCreate(savedInstanceState);
91 eventDelegate.onCreate(savedInstanceState);
92 }
void onCreate(Bundle savedInstanceState)

◆ onDestroy()

void io.flutter.app.FlutterActivity.onDestroy ( )
inlineprotected

Definition at line 107 of file FlutterActivity.java.

107 {
108 eventDelegate.onDestroy();
109 super.onDestroy();
110 }

◆ onLowMemory()

void io.flutter.app.FlutterActivity.onLowMemory ( )
inline

Definition at line 172 of file FlutterActivity.java.

172 {
173 eventDelegate.onLowMemory();
174 }

◆ onNewIntent()

void io.flutter.app.FlutterActivity.onNewIntent ( Intent  intent)
inlineprotected

Definition at line 151 of file FlutterActivity.java.

151 {
152 eventDelegate.onNewIntent(intent);
153 }

◆ onPause()

void io.flutter.app.FlutterActivity.onPause ( )
inlineprotected

Definition at line 126 of file FlutterActivity.java.

126 {
127 super.onPause();
128 eventDelegate.onPause();
129 }

◆ onPostResume()

void io.flutter.app.FlutterActivity.onPostResume ( )
inlineprotected

Definition at line 132 of file FlutterActivity.java.

132 {
133 super.onPostResume();
134 eventDelegate.onPostResume();
135 }

◆ onRequestPermissionsResult()

void io.flutter.app.FlutterActivity.onRequestPermissionsResult ( int  requestCode,
@NonNull String[]  permissions,
@NonNull int[]  grantResults 
)
inline

Definition at line 138 of file FlutterActivity.java.

139 {
140 eventDelegate.onRequestPermissionsResult(requestCode, permissions, grantResults);
141 }
boolean onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)

◆ onResume()

void io.flutter.app.FlutterActivity.onResume ( )
inlineprotected

Definition at line 101 of file FlutterActivity.java.

101 {
102 super.onResume();
103 eventDelegate.onResume();
104 }

◆ onStart()

void io.flutter.app.FlutterActivity.onStart ( )
inlineprotected

Definition at line 95 of file FlutterActivity.java.

95 {
96 super.onStart();
97 eventDelegate.onStart();
98 }

◆ onStop()

void io.flutter.app.FlutterActivity.onStop ( )
inlineprotected

Definition at line 120 of file FlutterActivity.java.

120 {
121 eventDelegate.onStop();
122 super.onStop();
123 }

◆ onTrimMemory()

void io.flutter.app.FlutterActivity.onTrimMemory ( int  level)
inline

Definition at line 167 of file FlutterActivity.java.

167 {
168 eventDelegate.onTrimMemory(level);
169 }

◆ onUserLeaveHint()

void io.flutter.app.FlutterActivity.onUserLeaveHint ( )
inline

Definition at line 156 of file FlutterActivity.java.

156 {
157 eventDelegate.onUserLeaveHint();
158 }

◆ onWindowFocusChanged()

void io.flutter.app.FlutterActivity.onWindowFocusChanged ( boolean  hasFocus)
inline

Definition at line 161 of file FlutterActivity.java.

161 {
162 super.onWindowFocusChanged(hasFocus);
163 eventDelegate.onWindowFocusChanged(hasFocus);
164 }
void onWindowFocusChanged(boolean hasFocus)

◆ registrarFor()

final Registrar io.flutter.app.FlutterActivity.registrarFor ( String  pluginKey)
inline

Definition at line 84 of file FlutterActivity.java.

84 {
85 return pluginRegistry.registrarFor(pluginKey);
86 }
Registrar registrarFor(@NonNull String pluginKey)

◆ retainFlutterNativeView()

boolean io.flutter.app.FlutterActivity.retainFlutterNativeView ( )
inline

Hook for subclasses to indicate that the FlutterNativeView returned by createFlutterNativeView() should not be destroyed when this activity is destroyed.

Returns
Whether the FlutterNativeView is retained.

Implements io.flutter.app.FlutterActivityDelegate.ViewFactory.

Definition at line 69 of file FlutterActivity.java.

69 {
70 return false;
71 }

◆ valuePublishedByPlugin()

final< T > T io.flutter.app.FlutterActivity.valuePublishedByPlugin ( String  pluginKey)
inline

Definition at line 79 of file FlutterActivity.java.

79 {
80 return pluginRegistry.valuePublishedByPlugin(pluginKey);
81 }
< T > T valuePublishedByPlugin(@NonNull String pluginKey)

The documentation for this class was generated from the following file: