Android - How to create a Permanent Notification -


i have created notification in "oncreate" activity method.

everything runs smoothly, can close pressing "delete all" button.

how make notification perma? in should more of info rather notification..

this current code:

    private void shownotification() {     // todo auto-generated method stub     nmn = (notificationmanager) getsystemservice(notification_service);     notification n  = new notification.builder(this)     .setcontenttitle("whip , weep")     .setcontenttext("whip on!")     .setsmallicon(r.drawable.ic_launcher)     .build();     nmn.notify(notification_id, n); } 

on notification builder use .setongoing(true) , prevent user removing notification.

see notification builder documentation more info: http://developer.android.com/reference/android/app/notification.builder.html#setongoing%28boolean%29


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -