如何写精华回答,获更多曝光?
发布
如题 java开发中 可以使用如下代码实现长驻任务,ets中应该怎么开发呢?
// 创建通知,其中1005为notificationId
NotificationRequest request = new NotificationRequest(NOTICE_ID);
NotificationRequest.NotificationNormalContent content = new NotificationRequest.NotificationNormalContent();
content.setTitle("前台服务");
NotificationRequest.NotificationContent notificationContent = new NotificationRequest.NotificationContent(content);
request.setContent(notificationContent);
// 绑定通知,1005为创建通知时传入的notificationId
keepBackgroundRunning(NOTICE_ID, request);