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 - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -