[Android] getAppSystemService util extension function
Geoffrey Métais
git at videolan.org
Wed Jul 4 18:44:12 CEST 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jul 4 15:43:33 2018 +0200| [e8dd13e1276ea31496da29386c9b9d9281d8527d] | committer: Geoffrey Métais
getAppSystemService util extension function
> https://code.videolan.org/videolan/vlc-android/commit/e8dd13e1276ea31496da29386c9b9d9281d8527d
---
vlc-android/src/org/videolan/vlc/util/Kextensions.kt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/util/Kextensions.kt b/vlc-android/src/org/videolan/vlc/util/Kextensions.kt
index 031ae3aab..da7221a8b 100644
--- a/vlc-android/src/org/videolan/vlc/util/Kextensions.kt
+++ b/vlc-android/src/org/videolan/vlc/util/Kextensions.kt
@@ -2,6 +2,7 @@ package org.videolan.vlc.util
import android.arch.lifecycle.ViewModel
import android.arch.lifecycle.ViewModelProviders
+import android.content.Context
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentActivity
import kotlinx.coroutines.experimental.delay
@@ -48,3 +49,4 @@ suspend fun retry (
fun Media?.canExpand() = this != null && (type == Media.Type.Directory || type == Media.Type.Playlist)
+fun Context.getAppSystemService(name: String) = applicationContext.getSystemService(name)
\ No newline at end of file
More information about the Android
mailing list