Question: So I'm not sure where/how to implement this method to make my service run in the foreground. Currently I start my service by the following in another activity: 

```
Intent i = new Intent(context, myService.class); 
context.startService(i);

```

And then in myServices' onCreate() I try the startForeground()...? 

```
Notification notification = new Notification();
startForeground(1, notification);

```

So yeah I'm a bit lost and unsure of how to implement this.

Answer: 
I'd start by completely filling in the `Notification`. [Here is a sample project](https://github.com/commonsguy/cw-omnibus/tree/v8.4/Notifications/Foreground) demonstrating the use of `startForeground()`.
In addition to **RAWA** answer, this peace of code: 

```
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
    startForegroundService(intent)
} else {
    startService(intent)
}

```

You can change to:

```
ContextCompat.startForegroundService(context, yourIntent);

```

If you will look inside this method then you can see that this method do all checking work for you.