Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
ef27cc72
Commit
ef27cc72
authored
3 years ago
by
Nicolas Pomepuy
Browse files
Options
Downloads
Patches
Plain Diff
Wait for the UI thread to be ready before starting foreground services
parent
896748d5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1175
Fix multiple crashes
Pipeline
#163833
passed with stage
in 5 minutes and 54 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/resources/src/main/java/org/videolan/resources/util/Extensions.kt
+6
-2
6 additions, 2 deletions
...s/src/main/java/org/videolan/resources/util/Extensions.kt
with
6 additions
and
2 deletions
application/resources/src/main/java/org/videolan/resources/util/Extensions.kt
+
6
−
2
View file @
ef27cc72
...
...
@@ -93,7 +93,11 @@ fun Context.launchForeground(intent: Intent) {
try
{
startService
(
intent
)
}
catch
(
e
:
IllegalStateException
)
{
intent
.
putExtra
(
"foreground"
,
true
)
ContextCompat
.
startForegroundService
(
this
,
intent
)
//wait for the UI thread to be ready
val
ctx
=
this
AppScope
.
launch
(
Dispatchers
.
Main
)
{
intent
.
putExtra
(
"foreground"
,
true
)
ContextCompat
.
startForegroundService
(
ctx
,
intent
)
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Nicolas Pomepuy
@Aza
mentioned in commit
7e7d5f68
·
3 years ago
mentioned in commit
7e7d5f68
mentioned in commit 7e7d5f68dffb142bf2d0045586b2ab1e0dec3748
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment