android 6.X 是23 所以需要大于23,这样使用的26.
import android.os.Build;
if(Build.VERSION.SDK_INT >= 26) {
context.startForegroundService(serviceIntent);
} else {
context.startService(intent);
}
android 6.X 是23 所以需要大于23,这样使用的26.
import android.os.Build;
if(Build.VERSION.SDK_INT >= 26) {
context.startForegroundService(serviceIntent);
} else {
context.startService(intent);
}