I need help to do something. I try to display a notification into the android statusbar.
It will inform the user that a synchronization with the server is in progress.
Now, I use this code and it works fine :
NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
.setSmallIcon(android.R.drawable.stat_notify_sync).setWhen(System.currentTimeMillis())
.setAutoCancel(false).setOngoing(true);
NotificationManager nm = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notif = builder.getNotification();
nm.notify(1, notif);
The only one problem is that a view is created when the user expand the statusbar. What I want to do is only display a small icon on the top of the status bar, without the contentview.
Anyone know how to do that ? Thanks in advance!
.
stackoverflow.comm
No comments:
Post a Comment