Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flutter_boost_1.22.4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢冠章
flutter_boost_1.22.4
Commits
708bc523
Commit
708bc523
authored
Oct 21, 2019
by
yangwu.jia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug context is null
parent
e4f8192b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
android/src/main/java/com/idlefish/flutterboost/BoostPluginRegistry.java
...n/java/com/idlefish/flutterboost/BoostPluginRegistry.java
+9
-7
android/src/main/java/com/idlefish/flutterboost/NewFlutterBoost.java
.../main/java/com/idlefish/flutterboost/NewFlutterBoost.java
+4
-3
No files found.
android/src/main/java/com/idlefish/flutterboost/BoostPluginRegistry.java
View file @
708bc523
...
@@ -2,6 +2,7 @@ package com.idlefish.flutterboost;
...
@@ -2,6 +2,7 @@ package com.idlefish.flutterboost;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Context
;
import
android.support.annotation.Nullable
;
import
com.idlefish.flutterboost.interfaces.IContainerRecord
;
import
com.idlefish.flutterboost.interfaces.IContainerRecord
;
import
io.flutter.app.FlutterPluginRegistry
;
import
io.flutter.app.FlutterPluginRegistry
;
import
io.flutter.embedding.engine.FlutterEngine
;
import
io.flutter.embedding.engine.FlutterEngine
;
...
@@ -17,19 +18,20 @@ public class BoostPluginRegistry extends FlutterPluginRegistry {
...
@@ -17,19 +18,20 @@ public class BoostPluginRegistry extends FlutterPluginRegistry {
protected
WeakReference
<
Activity
>
mCurrentActivityRef
;
protected
WeakReference
<
Activity
>
mCurrentActivityRef
;
private
FlutterEngine
mEngine
;
private
FlutterEngine
mEngine
;
private
Context
mContext
;
public
BoostPluginRegistry
(
FlutterEngine
engine
,
Context
context
)
{
public
BoostPluginRegistry
(
FlutterEngine
engine
,
Context
context
)
{
super
(
engine
,
context
);
super
(
engine
,
context
);
mEngine
=
engine
;
mEngine
=
engine
;
mContext
=
context
;
}
}
public
PluginRegistry
.
Registrar
registrarFor
(
String
pluginKey
)
{
public
PluginRegistry
.
Registrar
registrarFor
(
String
pluginKey
)
{
return
new
BoostRegistrar
(
mEngine
,
super
.
registrarFor
(
pluginKey
));
return
new
BoostRegistrar
(
mEngine
,
super
.
registrarFor
(
pluginKey
));
}
}
public
void
currentActivity
(
@Nullable
Activity
activity
)
{
mCurrentActivityRef
=
new
WeakReference
<>(
activity
);
}
public
class
BoostRegistrar
implements
PluginRegistry
.
Registrar
{
public
class
BoostRegistrar
implements
PluginRegistry
.
Registrar
{
...
@@ -70,12 +72,12 @@ public class BoostPluginRegistry extends FlutterPluginRegistry {
...
@@ -70,12 +72,12 @@ public class BoostPluginRegistry extends FlutterPluginRegistry {
@Override
@Override
public
Context
context
()
{
public
Context
context
()
{
return
mRegistrar
.
context
()
;
return
BoostPluginRegistry
.
this
.
mContext
;
}
}
@Override
@Override
public
Context
activeContext
()
{
public
Context
activeContext
()
{
return
mRegistrar
.
activeContext
()
;
return
BoostPluginRegistry
.
this
.
mContext
;
}
}
@Override
@Override
...
@@ -90,7 +92,7 @@ public class BoostPluginRegistry extends FlutterPluginRegistry {
...
@@ -90,7 +92,7 @@ public class BoostPluginRegistry extends FlutterPluginRegistry {
@Override
@Override
public
PlatformViewRegistry
platformViewRegistry
()
{
public
PlatformViewRegistry
platformViewRegistry
()
{
return
m
Registrar
.
platformView
Registry
();
return
m
Engine
.
getPlatformViewsController
().
get
Registry
();
}
}
@Override
@Override
...
...
android/src/main/java/com/idlefish/flutterboost/NewFlutterBoost.java
View file @
708bc523
...
@@ -44,6 +44,8 @@ public class NewFlutterBoost {
...
@@ -44,6 +44,8 @@ public class NewFlutterBoost {
doInitialFlutterViewRun
(
mPlatform
);
doInitialFlutterViewRun
(
mPlatform
);
}
}
registry
=
new
BoostPluginRegistry
(
this
.
engineProvider
(),
mPlatform
.
getApplication
());
platform
.
getApplication
().
registerActivityLifecycleCallbacks
(
new
Application
.
ActivityLifecycleCallbacks
()
{
platform
.
getApplication
().
registerActivityLifecycleCallbacks
(
new
Application
.
ActivityLifecycleCallbacks
()
{
...
@@ -53,7 +55,7 @@ public class NewFlutterBoost {
...
@@ -53,7 +55,7 @@ public class NewFlutterBoost {
if
(
mPlatform
.
whenEngineStart
()
==
ConfigBuilder
.
ANY_ACTIVITY_CREATED
)
{
if
(
mPlatform
.
whenEngineStart
()
==
ConfigBuilder
.
ANY_ACTIVITY_CREATED
)
{
Log
.
e
(
"bbbb2"
,
"xxxxx"
);
Log
.
e
(
"bbbb2"
,
"xxxxx"
);
registry
.
currentActivity
(
activity
);
doInitialFlutterViewRun
(
mPlatform
);
doInitialFlutterViewRun
(
mPlatform
);
}
}
}
}
...
@@ -117,8 +119,7 @@ public class NewFlutterBoost {
...
@@ -117,8 +119,7 @@ public class NewFlutterBoost {
});
});
registry
=
new
BoostPluginRegistry
(
this
.
engineProvider
(),
mPlatform
.
getApplication
());
mPlatform
.
registerPlugins
(
registry
);
mPlatform
.
registerPlugins
(
registry
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment