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
Post a Comment