Reputation: 151
I want to make a notification which cannot be cancelled by the user manually, just like google navigation notification. I don't know how to do it. Please Help.
Below is my code that I had tried.
mBuilder.setSmallIcon(R.mipmap.ic_launcher)
.setOngoing(true)
.setContentIntent(pendIntent)
.setContent(mRemoteViews)
.setPriority(0)
.setTicker(ticker);
Thanks.
Upvotes: 0
Views: 195
Reputation: 5392
Try adding this
mBuilder.setOngoing(true)
Other option is to use intentService or background service to make your notification for you instead of the application context.
Upvotes: 1