मैंने एंड्रॉइड 6.0 को अपग्रेड किया और मेरे ऐप में समस्या है।पृष्ठभूमि रंग सफेद होने पर एंड्रॉइड अधिसूचना आइकन रंग बदला नहीं जाता है
जब स्टेटस बार पृष्ठभूमि रंग सफेद नहीं है, अधिसूचना आइकन अच्छा है। (अधिसूचना आइकन पीएनजी में केवल सफेद और अल्फा है)
लेकिन यदि कुछ ऐप्स पृष्ठभूमि रंग को सफेद में बदलते हैं, तो मेरा अधिसूचना आइकन काला में उलटा नहीं है।
स्थिति बार पृष्ठभूमि रंग अन्य ऐप द्वारा सफेद सेट करते समय मैं सफेद अधिसूचना आइकन को काला में कैसे बदल सकता हूं? (मैं यह नहीं कह रहा हूं कि मैं रंग आइकन का उपयोग कैसे कर सकता हूं।)
छवि के नीचे एक समस्या दिखाती है।
when changed background color to white, my icon is not changed to black only
अधिसूचना निर्माण कोड
Notification.Builder mBuilder = new Notification.Builder(context) .setSmallIcon(R.drawable.ic_notifications_none) .setPriority(priority2) .setOngoing(true); mBuilder.setContent(generateMessageView(message)); Intent notificationIntent = new Intent(context, MainActivity.class); notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, 0); NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); mBuilder.setContentIntent(intent); mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
मान-v23/styles.xml
<style name="AppTheme" parent="android:Theme.Material.NoActionBar"> </style>
** मिले एक समाधान **
मैं drawable निर्देशिका के लिए सूचना आइकन जोड़ा drawable- नहीं * डीपीआई। अब यह काम कर रहा है।
चेक बाहर इस [पोस्ट] (सूचना आइकन सेट http://stackoverflow.com/questions/28387602/notification-bar-icon-turns-white- इन-एंड्रॉयड-5-लॉलीपॉप)। यह भी पढ़ें [प्रलेखन] (http://developer.android.com/reference/android/app/Notification.Builder.html#setColor%28int%29)। उम्मीद है कि आप एक सुराग प्राप्त कर सकते हैं। चीयर्स ....:) – verbose
@verbose मैं पहले ही पढ़ चुका हूं लेकिन फिर से जांच करूंगा। धन्यवाद –
मैंने आपके समाधान की कोशिश की और यह मेरे लिए काम नहीं किया। –