I am trying to display a indeterminate progress bar in the notification window. But it is not displayed.
This is my code
int id = 1;
NotificationManager mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Builder mBuilder = new NotificationCompat.Builder(
MenuActivity.this);
mBuilder.setContentTitle("My app")
.setContentText("Download in progress");
mBuilder.setProgress(0, 0, true);
// Issues the notification
mNotifyManager.notify(id, mBuilder.build());
I am following this link Continuing Activity Indicator
Can someone guide me out what's wrong?
solved only needed to add an icon
.setSmallIcon(R.drawable.ic_notification);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With