Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_flowbox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_flowbox
Commits
58d12511
Commit
58d12511
authored
Jul 27, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化bugly空指针问题
parent
2d499c64
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
13 deletions
+4
-13
ScreenObserver.kt
...java/com/mints/flowbox/keepalive/screen/ScreenObserver.kt
+0
-4
ForegroundOrBackground.java
.../java/com/mints/flowbox/utils/ForegroundOrBackground.java
+4
-9
No files found.
app/src/main/java/com/mints/flowbox/keepalive/screen/ScreenObserver.kt
View file @
58d12511
...
...
@@ -264,10 +264,6 @@ class ScreenLockerObserver(private val context: Context) {
if
(
IntentUtils
.
isRunningForeground
(
context
)
&&
ForegroundOrBackground
.
getApp_activity
()
!=
null
)
{
ForegroundOrBackground
.
getApp_activity
().
moveTaskToBack
(
true
)
}
// val activity = context as Activity
// if (activity !is ScreenActivity) {
// activity.moveTaskToBack(true)
// }
try
{
BrandEventLogger
.
logEventWithBrand
(
...
...
app/src/main/java/com/mints/flowbox/utils/ForegroundOrBackground.java
View file @
58d12511
...
...
@@ -29,7 +29,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
//获取当前最上层的activity
private
static
WeakReference
<
Activity
>
app_activity
;
private
static
WeakReference
<
Activity
>
main_activity
;
private
static
WeakReference
<
Activity
>
trans_activity
;
private
WeakReference
<
VersionUpdatePresenter
>
vupWeakReference
;
private
VersionUpdatePresenter
vup
;
private
WeakReference
<
Activity
>
reference
;
...
...
@@ -62,10 +61,10 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
public
static
Activity
getMain_activity
()
{
try
{
if
(
main_activity
.
get
()
!=
null
)
{
if
(
main_activity
!=
null
&&
main_activity
.
get
()
!=
null
)
{
return
main_activity
.
get
();
}
return
app_activity
.
get
()
;
return
null
;
}
catch
(
NullPointerException
e
)
{
e
.
printStackTrace
();
return
null
;
...
...
@@ -74,10 +73,10 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
public
static
Activity
getApp_activity
()
{
try
{
if
(
app_activity
.
get
()
!=
null
)
{
if
(
app_activity
!=
null
&&
app_activity
.
get
()
!=
null
)
{
return
app_activity
.
get
();
}
return
main_activity
.
get
();
return
getMain_activity
();
}
catch
(
NullPointerException
e
)
{
e
.
printStackTrace
();
return
null
;
...
...
@@ -136,10 +135,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
if
(
TextUtils
.
equals
(
activity
.
getClass
().
getSimpleName
(),
"MainActivity"
))
{
main_activity
=
new
WeakReference
<>(
activity
);
}
if
(
TextUtils
.
equals
(
activity
.
getClass
().
getSimpleName
(),
"TransPlaceActivity"
))
{
trans_activity
=
new
WeakReference
<>(
activity
);
}
}
@Override
...
...
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