Tuesday, April 9, 2013

[android help] Android Display a notification into the statusbar without an expandable view


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

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...