CheckVersionLib
CheckVersionLib copied to clipboard
RemoteServiceException
VersionService init()
private void init() {
//https://issuetracker.google.com/issues/76112072
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
startForeground(NotificationHelper.NOTIFICATION_ID, NotificationHelper.createSimpleNotification(this));
if (builder != null) {
isServiceAlive = true;
builderHelper = new BuilderHelper(getApplicationContext(), builder);
notificationHelper = new NotificationHelper(getApplicationContext(), builder);
startForeground(NotificationHelper.NOTIFICATION_ID, notificationHelper.getServiceNotification());
executors = Executors.newSingleThreadExecutor();
executors.submit(new Runnable() {
@Override
public void run() {
onHandleWork();
}
});
} else {
AllenVersionChecker.getInstance().cancelAllMission(this);
}
}
为什么要startForeground两次?
@AlexLiuSheng