पर काम नहीं कर रहा है मेरे पास निम्न कोड है लेकिन हर बार जब मैं सिर्फ डिफ़ॉल्ट एंड्रॉइड ध्वनि सुनता हूं।एंड्रॉइड 8 नोटिफिकेशन सेट
// create channel
NotificationChannel channel = new NotificationChannel(ANDROID_CHANNEL_ID,
ANDROID_CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT);
// Sets whether notifications posted to this channel should display notification lights
channel.enableLights(true);
// Sets whether notification posted to this channel should vibrate.
channel.enableVibration(true);
// Sets the notification light color for notifications posted to this channel
channel.setLightColor(Color.GREEN);
// Sets whether notifications posted to this channel appear on the lockscreen or not
//channel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
channel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
Uri uri = Uri.parse("android.resource://"+this.getPackageName()+"/" + R.raw.aperturaabductores);
AudioAttributes att = new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_NOTIFICATION)
.setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
.build();
channel.setSound(uri,att);
यह मेरा ध्वनि pablomonteserin.es/aperturaabductores.wav
कोई भी वास्तव में नहीं? – Ricardo
परीक्षण किया गया। एम्यूलेटर में काम करना –
मेरे एमुलेटर और डिवाइस में काम नहीं कर रहा है। क्या आपने एंड्रॉइड 8 पर परीक्षण किया था? कृपया ध्यान दें कि मैं एक कस्टम ध्वनि लोड करना चाहता हूं। – Ricardo