मैं एक अधिसूचना दिखाने की कोशिश कर रहा हूं जिसे उपयोगकर्ता को टैप करते समय हटाया जाना है। मैं अपनी अधिसूचना बनाने के लिए NotificationCompat
कक्षा का उपयोग कर रहा हूं और मैं पर अपने पर कॉल करता हूं। इस कोड का टुकड़ा है:अधिसूचना सेटऑटोकैंकल (सत्य) काम नहीं करता
NotificationCompat.Builder mBuilder= new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle("title")
.setAutoCancel(true)
.setContentText("content");
NotificationManager notificationManager= (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, mBuilder.build());
अधिसूचना सही ढंग से जोड़ा जाता है लेकिन जब मैं उस पर टैप कुछ नहीं होता! मैं कहाँ गलत हूँ?
अधिसूचना बस वहां रहती है? क्या होता है जब आप इसे खारिज करने के लिए इसे स्वाइप करते हैं? आप किस डिवाइस और एपीआई संस्करण चल रहे हैं? –
मैं गैलेक्सी नेक्सस, एपीआई 4.2.2 पर चल रहा हूं। अधिसूचना गायब हो जाती है अगर मैं इसे स्वाइप करता हूं, लेकिन अगर मैं बस इसे टैप करता हूं तो कुछ भी नहीं होता है। – TheModularMind