how to display Notificaion on android api level 19 -


 <कोड> सार्वजनिक शून्य onClick (v देखें) {आशय notificationIntent = नए आशय (यह, MainActivity.class); लंबित सामग्री सामग्रीइंटेंट = लंबित आईटीएक्टिवटिविटी (यह, 1, अधिसूचना सूचना, लंबित प्रदाता। FLAG_CANCEL_CURRENT); NotificationManager nm = (अधिसूचना प्रबंधक) यह .getSystemService (संदर्भ। NETIFICATION_SERVICE); संसाधन res = this.getResources (); अधिसूचना.बिल्डर बिल्डर = नया अधिसूचना.बिल्डर (यह); builder.setContentIntent (contentIntent) .setSmallIcon (R.drawable.ic_launcher) .setLargeIcon (BitmapFactory.decodeResource (रेस, R.drawable.ic_launcher))। setTicker ( "Helllo") .setWhen (System.currentTimeMillis ())। setAutoCancel ( True) .setContentTitle ("मेस्गेस")। SetContentText ("मैसेज 22"); अधिसूचना n = बिल्डर। बिल्ड (); Nm.notify (5, n); }   

मैं संदेश notifcation बटन पर क्लिक करने पर के लिए इस कोड का उपयोग करने की कोशिश कर रहा हूं, लेकिन कोड यह दिखाने त्रुटि कॉल में आ रहा है त्रुटि है एपीआई स्तर 11 की आवश्यकता है (वर्तमान मिनट है 8): android.app .Notification.Builder # setContentIntent मैं परियोजना एपीआई स्तर 19 निर्धारित किया है मेरी मदद कृपया जहां गलत कर रहा हूँ कृपया मुझे सुझाव है कि समाधान लक्ष्य = एंड्रॉयड -19 परियोजना Proprties जब मैं के लिए कोड है:

 <कोड> & lt; उपयोग-एसडीके एंड्रॉइड: minSdkVersion = "8" एंड्रॉइड: targetSdkVersion = "19" / & gt;    

यदि आपका ऐप एंड्रॉइड के रूप में पुराना है एपीआई स्तर 4, आप के बजाय में NotificationCompat.Builder , उपलब्ध का उपयोग कर सकते

Notification.Builder -। इस वर्ग में जोड़ा गया एंड्रॉयड 3.0 मधुकोश [एपीआई 11] । तो तुम बड़े समर्थन करने की आवश्यकता है, तो SDKâ ???? रों आपको NotificationCompat.Builder एक के बजाय NotificationCompact का उपयोग करना होगा।

????

Comments

Popular posts from this blog

Out of index C/C++ -

regex - PatternSyntaxException: while using String.ReplaceAll function in java? -

java - Projects which are accessed via multiple (different) IDEs: Ant or Maven? -