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
fc33c4c1
Commit
fc33c4c1
authored
Jul 07, 2021
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化广告广播内存泄露导致的奔溃
parent
b88d4e35
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
VideoAdingManager.java
...in/java/com/mints/flowbox/ad/video/VideoAdingManager.java
+4
-1
AwardActivity.kt
...main/java/com/mints/flowbox/ui/activitys/AwardActivity.kt
+11
-2
No files found.
app/src/main/java/com/mints/flowbox/ad/video/VideoAdingManager.java
View file @
fc33c4c1
...
...
@@ -85,6 +85,7 @@ public class VideoAdingManager {
// APP下载回调广播
private
BroadcastReceiver
mReceiverBroadcastReceiver
=
null
;
private
boolean
receiverFlag
=
false
;
// 广播是否注册
private
void
registerBroad
()
{
// 是否是超级翻倍标识 false-返回
...
...
@@ -121,6 +122,8 @@ public class VideoAdingManager {
IntentFilter
intentFilter
=
new
IntentFilter
();
intentFilter
.
addAction
(
AppInstallService
.
APP_INSTALL_ACTION
);
activity
.
registerReceiver
(
this
.
mReceiverBroadcastReceiver
,
intentFilter
);
receiverFlag
=
true
;
}
/**
...
...
@@ -429,7 +432,7 @@ public class VideoAdingManager {
csjGroMoreVideoAdManager
=
null
;
}
if
(
mReceiverBroadcastReceiver
!=
null
)
{
if
(
mReceiverBroadcastReceiver
!=
null
&&
receiverFlag
)
{
activity
.
stopService
(
new
Intent
(
activity
,
AppInstallService
.
class
));
activity
.
unregisterReceiver
(
mReceiverBroadcastReceiver
);
mReceiverBroadcastReceiver
=
null
;
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/AwardActivity.kt
View file @
fc33c4c1
...
...
@@ -58,6 +58,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
private
var
superTaskStatus
=
0
private
var
mCurrentPkg
:
String
?
=
null
private
var
mReceiverBroadcastReceiver
:
BroadcastReceiver
?
=
null
private
var
receiverFlag
=
false
// 广播是否注册
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_award
...
...
@@ -429,7 +430,11 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
videoAdingManager
.
setVideoAdingListener
(
null
)
videoAdingManager
.
onDestroy
()
if
(
mReceiverBroadcastReceiver
!=
null
)
{
if
(
ivRootAwardAd
!=
null
){
Glide
.
with
(
applicationContext
).
clear
(
ivRootAwardAd
)
}
if
(
mReceiverBroadcastReceiver
!=
null
&&
receiverFlag
)
{
mContext
.
stopService
(
Intent
(
context
,
AppInstallService
::
class
.
java
))
mContext
.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
mReceiverBroadcastReceiver
=
null
...
...
@@ -704,7 +709,9 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
if
(
flAwardAd
.
height
>
0
&&
flAwardAd
.
width
>
0
)
{
ivRootAwardAd
.
visibility
=
View
.
VISIBLE
Glide
.
with
(
context
).
asGif
().
load
(
R
.
drawable
.
bg_award_effect
).
into
(
ivRootAwardAd
)
if
(!
AwardActivity
@this
.
isFinishing
){
Glide
.
with
(
applicationContext
).
asGif
().
load
(
R
.
drawable
.
bg_award_effect
).
into
(
ivRootAwardAd
)
}
}
// }
// }
...
...
@@ -824,5 +831,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
val
intentFilter
=
IntentFilter
()
intentFilter
.
addAction
(
AppInstallService
.
APP_INSTALL_ACTION
)
mContext
.
registerReceiver
(
this
.
mReceiverBroadcastReceiver
,
intentFilter
)
receiverFlag
=
true
}
}
\ No newline at end of file
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