Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
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_vedio
Commits
89692725
Commit
89692725
authored
Oct 13, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
b087bc27
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
340 additions
and
295 deletions
+340
-295
AndroidManifest.xml
video/app/src/main/AndroidManifest.xml
+289
-291
ActivityPageManager.java
...va/com/duben/miniplaylet/manager/ActivityPageManager.java
+18
-0
SplashActivity.kt
...java/com/duben/miniplaylet/ui/activitys/SplashActivity.kt
+21
-2
SplashAdActivity.kt
...va/com/duben/miniplaylet/ui/activitys/SplashAdActivity.kt
+9
-1
ForegroundOrBackground.java
...a/com/duben/miniplaylet/utils/ForegroundOrBackground.java
+3
-1
No files found.
video/app/src/main/AndroidManifest.xml
View file @
89692725
This diff is collapsed.
Click to expand it.
video/app/src/main/java/com/duben/miniplaylet/manager/ActivityPageManager.java
View file @
89692725
...
...
@@ -6,6 +6,8 @@ import android.content.ComponentName;
import
android.content.Context
;
import
android.text.TextUtils
;
import
com.duben.miniplaylet.utils.LogUtil
;
import
java.util.List
;
import
java.util.Stack
;
...
...
@@ -83,6 +85,21 @@ public class ActivityPageManager {
return
null
;
}
/**
* 是否包含指定类名的Activity
*
* @param clazz Activity.class
*/
public
boolean
containActivity
(
Class
<?>
clazz
)
{
for
(
Activity
activity
:
mActivityStack
)
{
LogUtil
.
d
(
"AAAAAAAA"
+
activity
.
getClass
().
getSimpleName
());
if
(
activity
.
getClass
().
equals
(
clazz
))
{
return
true
;
}
}
return
false
;
}
/**
* 结束当前Activity (堆栈中最后一个添加的)
*/
...
...
@@ -178,4 +195,5 @@ public class ActivityPageManager {
}
return
false
;
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/miniplaylet/ui/activitys/SplashActivity.kt
View file @
89692725
package
com.duben.miniplaylet.ui.activitys
import
android.annotation.SuppressLint
import
android.content.Intent
import
android.os.Bundle
import
android.view.KeyEvent
import
android.view.View
...
...
@@ -10,6 +11,7 @@ import com.duben.miniplaylet.ad.splash.SplashManager
import
com.duben.miniplaylet.common.Constant
import
com.duben.miniplaylet.common.Constant.PRIVACY_URL
import
com.duben.miniplaylet.common.Constant.REGISTER_URL
import
com.duben.miniplaylet.manager.ActivityPageManager
import
com.duben.miniplaylet.manager.TrackManager
import
com.duben.miniplaylet.ui.activitys.base.BaseActivity
import
com.duben.miniplaylet.ui.widgets.CycleProgress
...
...
@@ -41,7 +43,9 @@ class SplashActivity : BaseActivity() {
}
override
fun
initViewsAndEvents
()
{
if
(!
isTaskRoot
)
{
//点击Home键后再点击App图标,会回到原来的界面。今天重新打包后,但是在Debug模式下,一切正常,
// 但是把打完包的apk(Release)安装在其他手机上时,回到桌面后点击图标会重新打开启动页
finish
()
...
...
@@ -49,6 +53,13 @@ class SplashActivity : BaseActivity() {
}
mProgressBar
=
findViewById
(
R
.
id
.
progressBar
)
// showPowerDialog()
}
override
fun
onResume
()
{
LogUtil
.
d
(
"AAAAAAAAA isTaskRoot"
)
super
.
onResume
()
isAdSuc
=
false
showPowerDialog
()
}
...
...
@@ -105,7 +116,8 @@ class SplashActivity : BaseActivity() {
mProgressBar
!!
.
setCompleteNoAnim
()
}
// 跳转广告
readyGoThenKill
(
SplashAdActivity
::
class
.
java
)
// readyGoThenKill(SplashAdActivity::class.java)
readyGo
(
SplashAdActivity
::
class
.
java
)
}
}
}
...
...
@@ -140,7 +152,14 @@ class SplashActivity : BaseActivity() {
* 跳转到主页面
*/
private
fun
goToMainActivity
()
{
readyGoThenKill
(
MainActivity
::
class
.
java
)
// readyGoThenKill(MainActivity::class.java)
if
(
ActivityPageManager
.
getInstance
().
containActivity
(
MainActivity
::
class
.
java
))
{
LogUtil
.
d
(
"AAAAAAAAAAAAAAA"
)
finish
()
}
else
{
LogUtil
.
d
(
"BBBBBBBBBBBB"
)
readyGo
(
MainActivity
::
class
.
java
)
}
}
override
fun
onKeyDown
(
keyCode
:
Int
,
event
:
KeyEvent
):
Boolean
{
...
...
video/app/src/main/java/com/duben/miniplaylet/ui/activitys/SplashAdActivity.kt
View file @
89692725
...
...
@@ -8,6 +8,7 @@ import com.duben.miniplaylet.R
import
com.duben.miniplaylet.ad.AdStatusListener
import
com.duben.miniplaylet.ad.splash.SplashManager
import
com.duben.miniplaylet.common.Constant
import
com.duben.miniplaylet.manager.ActivityPageManager
import
com.duben.miniplaylet.manager.LocalVedioManager
import
com.duben.miniplaylet.manager.UserManager
import
com.duben.miniplaylet.ui.activitys.base.BaseActivity
...
...
@@ -95,7 +96,14 @@ class SplashAdActivity : BaseActivity() {
* 跳转到主页面
*/
private
fun
goToMainActivity
()
{
readyGoThenKill
(
MainActivity
::
class
.
java
)
// readyGoThenKill(MainActivity::class.java)
if
(
ActivityPageManager
.
getInstance
().
containActivity
(
MainActivity
::
class
.
java
))
{
LogUtil
.
d
(
"AAAAAAAAAAAAAAA"
)
finish
()
}
else
{
LogUtil
.
d
(
"BBBBBBBBBBBB"
)
readyGo
(
MainActivity
::
class
.
java
)
}
}
/**
...
...
video/app/src/main/java/com/duben/miniplaylet/utils/ForegroundOrBackground.java
View file @
89692725
...
...
@@ -107,7 +107,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
AppConfig
.
alipayBackFalg
=
false
;
}
}
else
{
activity
.
startActivity
(
new
Intent
(
activity
,
SplashBackActivity
.
class
));
//
activity.startActivity(new Intent(activity, SplashBackActivity.class));
}
// }
}
...
...
@@ -150,6 +150,8 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
e
.
printStackTrace
();
}
LogUtil
.
d
(
"AAAAAAAA remove --> "
+
activity
.
getClass
());
ActivityPageManager
.
getInstance
().
removeActivity
(
activity
);
}
}
\ 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