4

While setting up the VPN connection in android phone, a system level notification with 'key' icon is generated by android system automatically. I am building an App which requires to set up a TUN interface internally but I am afraid of this notification which will be shown in notification bar by android system. I do not want android system to show up this notification to user.

Secondly a warning message "Attention" is also popped up while setting up a VPN connection. Again this message is also generated by android system.

I wanted my app to run quietly without showing any warning message and notification in notification bar. Any idea on how this thing can be achieved ??

Thanks

mezda
  • 3,537
  • 6
  • 30
  • 37
vka
  • 41
  • 2

3 Answers3

0

You cannot remove or disable it without changing the ROM. It is an android feature.

Sandro Machado
  • 9,921
  • 4
  • 36
  • 57
0

May be you should try something like How to cancel Android notifications or How to properly clear all notification once clicked in two words - something like this:

// Clear all notification
NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancelAll();
} 
Community
  • 1
  • 1
MiddleD.
  • 315
  • 1
  • 4
  • 21
0

You can use the Xposed plugin NotifyClean to remove any notification, even the android system notify.

If you want to do it from source, viewing their source code may help.

recolic
  • 554
  • 4
  • 18