CheckVersionLib icon indicating copy to clipboard operation
CheckVersionLib copied to clipboard

RemoteServiceException

Open shuwenyouxi opened this issue 6 years ago • 1 comments

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两次?

shuwenyouxi avatar Jun 27 '19 04:06 shuwenyouxi

@AlexLiuSheng

shuwenyouxi avatar Jun 27 '19 04:06 shuwenyouxi