2
내가 안드로이드 백그라운드 서비스에서 내 논리를 퍼트하고 잠금 화면에서 한 번의 클릭/탭 작동하지 : -안드로이드 알림 잘 작동 내 끈적 notification.Everything의 onclick을 동작에서 시작하지만, 문제가 될,
- 내 휴대 전화를 잠글 때 알림을 클릭/탭하려고하면 두 번 클릭/항상 탭해야합니다.
- 내 논리는 백그라운드 서비스에 있지만 알림 배경 서비스를 클릭 한 후 내 모바일 잠금이 해제 될 때까지 시작되지 않습니다. (배경 서비스가 끈적 끈적) 코드 아래
가 끈적 알림을 생성하는 데 사용됩니다.
private void Notify() {
Context objContext = this.cordova.getActivity();
Intent objIntent = new Intent(objContext, ApiCallServeice.class);
PendingIntent pi = PendingIntent.getService(objContext, intNotificationId, objIntent, PendingIntent.FLAG_CANCEL_CURRENT);
Notification.Builder builder = new Notification.Builder(objContext);
builder.setContentTitle("Click to get help.");
builder.setAutoCancel(false);
builder.setSmallIcon(objContext.getApplicationInfo().icon);
builder.setOngoing(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
builder.setVisibility(Notification.VISIBILITY_PUBLIC);
}
builder.setContentIntent(pi);
builder.build();
myNotication = builder.getNotification();
manager.notify(intNotificationId, myNotication);
}
내 코드에 해결책을 제안하거나 플래그를 설정해야합니다. 알림 UI everwhere.We에 클릭을 얻기 위해