2011-08-11 24 views
5

Estoy haciendo una aplicación de asistencia en android. Quiero implementar una notificación para tickets no leídos (sugerencias o quejas de clientes). En la versión para iPhone de esta aplicación, incluso si la aplicación no abre un contador para tickets no leídos en el ícono de la aplicación, ¿es posible en Android? Si es así, ayúdenme a implementar iPhone como si no, ayúdenme a implementar la notificación normal de Android para tickets no leídos.¿Cómo hacer notificaciones en android?

Gracias

Respuesta

9

llamar a este método

private void triggerNotification(String s) { 
    CharSequence title = "Hello"; 
    CharSequence message = s; 
    NotificationManager notificationManager; 
    notificationManager = (NotificationManager) context 
      .getSystemService("notification"); 
    Notification notification; 
    notification = new Notification(
      com.yourPackage.R.drawable.notification, "Notifiy.. ", 
      System.currentTimeMillis()); 
    PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, 
     null, 0); 
    notification.setLatestEventInfo(context, title, message, pendingIntent); 
    notificationManager.notify(1010, notification); 
} 
Cuestiones relacionadas