Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
fallenstardust
YGOMobile
Commits
26430ddc
Commit
26430ddc
authored
Jul 27, 2022
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
activity被回收后直接清除所有Bundle
parent
ec82fb22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
23 deletions
+36
-23
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+36
-23
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
26430ddc
...
@@ -6,6 +6,7 @@ import android.view.MenuItem;
...
@@ -6,6 +6,7 @@ import android.view.MenuItem;
import
android.widget.FrameLayout
;
import
android.widget.FrameLayout
;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.fragment.app.Fragment
;
import
androidx.fragment.app.Fragment
;
...
@@ -50,29 +51,8 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
...
@@ -50,29 +51,8 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
setContentView
(
R
.
layout
.
activity_home
);
setContentView
(
R
.
layout
.
activity_home
);
setExitAnimEnable
(
false
);
setExitAnimEnable
(
false
);
mBundle
=
new
Bundle
();
mBundle
=
new
Bundle
();
QbSdk
.
PreInitCallback
cb
=
new
QbSdk
.
PreInitCallback
()
{
//
@Override
initQbSdk
();
public
void
onViewInitFinished
(
boolean
arg0
)
{
//x5內核初始化完成的回调,为true表示x5内核加载成功,否则表示x5内核加载失败,会自动切换到系统内核。
if
(
arg0
)
{
//Toast.makeText(getActivity(), "加载X5内核成功", Toast.LENGTH_SHORT).show();
}
else
{
//Toast.makeText(getActivity(), "加载系统内核成功", Toast.LENGTH_SHORT).show();
}
}
@Override
public
void
onCoreInitFinished
()
{
}
};
//x5内核初始化接口
QbSdk
.
initX5Environment
(
this
,
cb
);
if
(!
BuildConfig
.
BUILD_TYPE
.
equals
(
"debug"
))
{
//release才检查版本
if
(!
Constants
.
ACTION_OPEN_GAME
.
equals
(
getIntent
().
getAction
()))
{
Beta
.
checkUpgrade
(
false
,
false
);
}
}
//
//
checkNotch
();
checkNotch
();
//showNewbieGuide("homePage");
//showNewbieGuide("homePage");
...
@@ -80,6 +60,13 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
...
@@ -80,6 +60,13 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
onNewIntent
(
getIntent
());
onNewIntent
(
getIntent
());
}
}
@Override
protected
void
onSaveInstanceState
(
@NonNull
Bundle
outState
)
{
super
.
onSaveInstanceState
(
outState
);
//activity被回收后直接清除所有Bundle
outState
.
clear
();
}
@Override
@Override
protected
void
onNewIntent
(
Intent
intent
)
{
protected
void
onNewIntent
(
Intent
intent
)
{
super
.
onNewIntent
(
intent
);
super
.
onNewIntent
(
intent
);
...
@@ -196,6 +183,32 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
...
@@ -196,6 +183,32 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
}
}
}
}
private
void
initQbSdk
()
{
QbSdk
.
PreInitCallback
cb
=
new
QbSdk
.
PreInitCallback
()
{
@Override
public
void
onViewInitFinished
(
boolean
arg0
)
{
//x5內核初始化完成的回调,为true表示x5内核加载成功,否则表示x5内核加载失败,会自动切换到系统内核。
if
(
arg0
)
{
//Toast.makeText(getActivity(), "加载X5内核成功", Toast.LENGTH_SHORT).show();
}
else
{
//Toast.makeText(getActivity(), "加载系统内核成功", Toast.LENGTH_SHORT).show();
}
}
@Override
public
void
onCoreInitFinished
()
{
}
};
//x5内核初始化接口
QbSdk
.
initX5Environment
(
this
,
cb
);
if
(!
BuildConfig
.
BUILD_TYPE
.
equals
(
"debug"
))
{
//release才检查版本
if
(!
Constants
.
ACTION_OPEN_GAME
.
equals
(
getIntent
().
getAction
()))
{
Beta
.
checkUpgrade
(
false
,
false
);
}
}
}
@Override
@Override
protected
void
onResume
()
{
protected
void
onResume
()
{
...
...
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