fix restart service crash
This commit is contained in:
parent
660d6ff230
commit
be2fa3e444
@ -278,6 +278,7 @@ class MainService : Service() {
|
|||||||
Log.d("whichService", "this service: ${Thread.currentThread()}")
|
Log.d("whichService", "this service: ${Thread.currentThread()}")
|
||||||
super.onStartCommand(intent, flags, startId)
|
super.onStartCommand(intent, flags, startId)
|
||||||
if (intent?.action == ACT_INIT_MEDIA_PROJECTION_AND_SERVICE) {
|
if (intent?.action == ACT_INIT_MEDIA_PROJECTION_AND_SERVICE) {
|
||||||
|
createForegroundNotification()
|
||||||
Log.d(logTag, "service starting: ${startId}:${Thread.currentThread()}")
|
Log.d(logTag, "service starting: ${startId}:${Thread.currentThread()}")
|
||||||
val mediaProjectionManager =
|
val mediaProjectionManager =
|
||||||
getSystemService(MEDIA_PROJECTION_SERVICE) as MediaProjectionManager
|
getSystemService(MEDIA_PROJECTION_SERVICE) as MediaProjectionManager
|
||||||
|
Loading…
x
Reference in New Issue
Block a user