Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display a continuing progress bar in notification, android?

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?

like image 234
WISHY Avatar asked Feb 24 '15 10:02

WISHY


1 Answers

solved only needed to add an icon

.setSmallIcon(R.drawable.ic_notification);
like image 88
WISHY Avatar answered Nov 08 '22 10:11

WISHY