2011-08-11 3 views
5

나는 android에서 헬프 데스크 응용 프로그램을하고있다. 읽지 않은 티켓 (고객 제안 또는 불만)에 대한 알림을 구현하고 싶습니다. 이 앱의 iPhone 버전에서 앱이 앱 아이콘 자체에 읽지 않은 티켓의 카운터를 열지 않아도 안드로이드에서 가능합니다. 그렇다면 아이폰처럼 구현하도록 도와주세요. 그렇지 않으면 읽지 않은 티켓에 대한 일반 안드로이드 알림을 구현하는 데 도움이됩니다. 이 도움이 될 수안드로이드에서 알림을 보내는 방법?

감사

답변

9

호출이 방법

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); 
} 
관련 문제