আমি নতুন নোটিফিকেশন কমপ্যাট বিল্ডার ব্যবহার করেছি এবং আমি কোনও শব্দ করার জন্য বিজ্ঞপ্তিটি পেতে পারি না। এটি কম্পন এবং আলো ফ্ল্যাশ করবে। অ্যান্ড্রয়েড ডকুমেন্টেশন একটি স্টাইল সেট করতে বলে যা আমি এটি করেছিলাম:
builder.setStyle(new NotificationCompat.InboxStyle());
কিন্তু কোন শব্দ নেই?
সম্পূর্ণ কোড:
NotificationCompat.Builder builder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle("Notifications Example")
.setContentText("This is a test notification");
Intent notificationIntent = new Intent(this, MenuScreen.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(contentIntent);
builder.setAutoCancel(true);
builder.setLights(Color.BLUE, 500, 500);
long[] pattern = {500,500,500,500,500,500,500,500,500};
builder.setVibrate(pattern);
builder.setStyle(new NotificationCompat.InboxStyle());
// Add as notification
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(1, builder.build());
