Tuesday, September 7, 2010

Notification in Android

AIM :  Notification in Android.

SOLUTION



 int NOTIFICATION_ID=1;
 NotificationManager mManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);


Notification notification = new Notification(R.drawable.icon,"Notify", System.currentTimeMillis());


notification.setLatestEventInfo(getApplicationContext(), "Title", "Description", null);

mManager.notify(NOTIFICATION_ID, notification);; 


 To cancel  the same notification,call 


mManager.cancel(NOTIFICATION_ID);

No comments:

Post a Comment

Android Developers Blog

Ram's shared items

Amazon Product Ads