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
1
Merge Requests
1
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
ed8b02ae
Commit
ed8b02ae
authored
Feb 12, 2020
by
justin
Committed by
GitHub
Feb 12, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #592 from lucky-chen/bugfix/lifcecycle_init
[bugfix] fix crash:'FlutterBoostPlugin not register yet'
parents
c0ec5cb2
96b1f2c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
android/src/main/java/com/idlefish/flutterboost/FlutterBoost.java
...src/main/java/com/idlefish/flutterboost/FlutterBoost.java
+23
-2
No files found.
android/src/main/java/com/idlefish/flutterboost/FlutterBoost.java
View file @
ed8b02ae
...
@@ -26,6 +26,7 @@ public class FlutterBoost {
...
@@ -26,6 +26,7 @@ public class FlutterBoost {
private
FlutterEngine
mEngine
;
private
FlutterEngine
mEngine
;
private
Activity
mCurrentActiveActivity
;
private
Activity
mCurrentActiveActivity
;
private
PluginRegistry
mRegistry
;
private
PluginRegistry
mRegistry
;
private
boolean
mEnterActivityCreate
=
false
;
static
FlutterBoost
sInstance
=
null
;
static
FlutterBoost
sInstance
=
null
;
private
long
FlutterPostFrameCallTime
=
0
;
private
long
FlutterPostFrameCallTime
=
0
;
...
@@ -56,6 +57,10 @@ public class FlutterBoost {
...
@@ -56,6 +57,10 @@ public class FlutterBoost {
@Override
@Override
public
void
onActivityCreated
(
Activity
activity
,
Bundle
savedInstanceState
)
{
public
void
onActivityCreated
(
Activity
activity
,
Bundle
savedInstanceState
)
{
//fix crash:'FlutterBoostPlugin not register yet'
//case: initFlutter after Activity.OnCreate method,and then called start/stop crash
// In SplashActivity ,showDialog(in OnCreate method) to check permission, if authorized, then init sdk and jump homePage)
mEnterActivityCreate
=
true
;
mCurrentActiveActivity
=
activity
;
mCurrentActiveActivity
=
activity
;
if
(
mPlatform
.
whenEngineStart
()
==
ConfigBuilder
.
ANY_ACTIVITY_CREATED
)
{
if
(
mPlatform
.
whenEngineStart
()
==
ConfigBuilder
.
ANY_ACTIVITY_CREATED
)
{
doInitialFlutter
();
doInitialFlutter
();
...
@@ -70,6 +75,9 @@ public class FlutterBoost {
...
@@ -70,6 +75,9 @@ public class FlutterBoost {
@Override
@Override
public
void
onActivityStarted
(
Activity
activity
)
{
public
void
onActivityStarted
(
Activity
activity
)
{
if
(!
mEnterActivityCreate
){
return
;
}
if
(
mCurrentActiveActivity
==
null
)
{
if
(
mCurrentActiveActivity
==
null
)
{
Debuger
.
log
(
"Application entry foreground"
);
Debuger
.
log
(
"Application entry foreground"
);
...
@@ -84,16 +92,24 @@ public class FlutterBoost {
...
@@ -84,16 +92,24 @@ public class FlutterBoost {
@Override
@Override
public
void
onActivityResumed
(
Activity
activity
)
{
public
void
onActivityResumed
(
Activity
activity
)
{
if
(!
mEnterActivityCreate
){
return
;
}
mCurrentActiveActivity
=
activity
;
mCurrentActiveActivity
=
activity
;
}
}
@Override
@Override
public
void
onActivityPaused
(
Activity
activity
)
{
public
void
onActivityPaused
(
Activity
activity
)
{
if
(!
mEnterActivityCreate
){
return
;
}
}
}
@Override
@Override
public
void
onActivityStopped
(
Activity
activity
)
{
public
void
onActivityStopped
(
Activity
activity
)
{
if
(!
mEnterActivityCreate
){
return
;
}
if
(
mCurrentActiveActivity
==
activity
)
{
if
(
mCurrentActiveActivity
==
activity
)
{
Debuger
.
log
(
"Application entry background"
);
Debuger
.
log
(
"Application entry background"
);
...
@@ -108,11 +124,16 @@ public class FlutterBoost {
...
@@ -108,11 +124,16 @@ public class FlutterBoost {
@Override
@Override
public
void
onActivitySaveInstanceState
(
Activity
activity
,
Bundle
outState
)
{
public
void
onActivitySaveInstanceState
(
Activity
activity
,
Bundle
outState
)
{
if
(!
mEnterActivityCreate
){
return
;
}
}
}
@Override
@Override
public
void
onActivityDestroyed
(
Activity
activity
)
{
public
void
onActivityDestroyed
(
Activity
activity
)
{
if
(!
mEnterActivityCreate
){
return
;
}
if
(
mCurrentActiveActivity
==
activity
)
{
if
(
mCurrentActiveActivity
==
activity
)
{
Debuger
.
log
(
"Application entry background"
);
Debuger
.
log
(
"Application entry background"
);
...
...
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