2011-08-11 24 views
5

मैं एंड्रॉइड पर हेल्पडेस्क एप्लिकेशन कर रहा हूं। मैं अपठित टिकट (ग्राहक सुझाव या शिकायतों) के लिए अधिसूचना लागू करना चाहता हूं। इस ऐप के आईफोन संस्करण में, भले ही ऐप ऐप आइकन पर अपठित टिकटों के लिए काउंटर नहीं खोलता है, फिर भी यह एंड्रॉइड में संभव है। यदि ऐसा है तो कृपया मुझे आईफोन की तरह लागू करने में मदद करें अन्यथा मुझे अपठित टिकटों के लिए सामान्य एंड्रॉइड अधिसूचना लागू करने में मदद करें।एंड्रॉइड में अधिसूचना कैसे करें?

धन्यवाद

उत्तर

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); 
} 
संबंधित मुद्दे