summaryrefslogtreecommitdiffstats
path: root/android/app/src/main/java/eu/jopek/dingdongmail/StartReceiver.kt
blob: e5fad0bb41b0f8798e2940266c59523c5b7d132b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package eu.jopek.dingdongmail

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent

class StartReceiver: BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        log("Starting the service from a StartReceiver")
        Intent(context, MainWorkerService::class.java).also {
           it.action = Actions.START.name
           context.startForegroundService(it)
        }
    }

}