在某些不规范的安卓系统中,会禁止后台刷新,此时只能在前台启动 Service
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(new Intent(MainActivity.this, MessageQueueService.class));
} else {
startService(new Intent(MainActivity.this, MessageQueueService.class));
}