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
e87cb222
Commit
e87cb222
authored
Oct 13, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
4ed5cdbc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
AndroidManifest.xml
video/app/src/main/AndroidManifest.xml
+3
-0
SplashActivity.kt
...java/com/duben/miniplaylet/ui/activitys/SplashActivity.kt
+17
-0
No files found.
video/app/src/main/AndroidManifest.xml
View file @
e87cb222
...
...
@@ -81,6 +81,9 @@
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
<meta-data
android:name=
"is_launcher"
android:value=
"true"
/>
</activity>
<activity
...
...
video/app/src/main/java/com/duben/miniplaylet/ui/activitys/SplashActivity.kt
View file @
e87cb222
package
com.duben.miniplaylet.ui.activitys
import
android.annotation.SuppressLint
import
android.content.pm.PackageManager
import
android.os.Bundle
import
android.view.KeyEvent
import
android.view.View
...
...
@@ -50,6 +51,22 @@ class SplashActivity : BaseActivity() {
mProgressBar
=
findViewById
(
R
.
id
.
progressBar
)
showPowerDialog
()
val
isLaunchedFromLauncher
=
isLaunchedFromLauncher
()
if
(
isLaunchedFromLauncher
)
{
println
(
"mcg -->>>应用是通过点击桌面图标启动的"
)
// 应用是通过点击桌面图标启动的
}
else
{
println
(
"mcg -->>>应用是从后台恢复的"
)
// 应用是从后台恢复的
}
}
private
fun
isLaunchedFromLauncher
():
Boolean
{
val
activityInfo
=
packageManager
.
getActivityInfo
(
componentName
,
PackageManager
.
GET_META_DATA
)
val
bundle
=
activityInfo
.
metaData
return
bundle
!=
null
&&
bundle
.
getBoolean
(
"is_launcher"
,
false
)
}
override
fun
finish
()
{
...
...
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