2

i create an application and i want after click on specific button, a "Permanent Nofitication" show on notification bar. i search for it and use these codes:

NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
                        .setSmallIcon(R.mipmap.ic_clip_board_service)
                        .setContentTitle(getResources().getString(R.string.notifTitle))
                        .setContentText(getResources().getString(R.string.notifText))
                        .setOngoing(true);

the ongoing method, prevent user to manually clear the notification.in my emulator(genymotion), everything is ok.but in my real Phone(Huawei G8) when i try to remove notificaiton, a pop-up menu appeared and say:

Not Recomended

removing ongoing notification may affect app stability.

the menu has already two buttons:cancel and Remove.and i can remove the notification.:( i don't want user manually remove notification. is the problem about my Phone or setOngoing(true) method? thanks in advance...

linarcx
  • 116
  • 3
  • 17

1 Answers1

0

Based off what I'm seeing for my app that behaves similarly, it appear Huawei phone's always allow clearing notifications and shutting down the app. My app even runs as a device administrator and it can still be cleared.

CamHart
  • 3,825
  • 7
  • 33
  • 69