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

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

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

javascript - Chart.js - setting tooltip z-index -