जब मेरा नोटिफिकेशन आता है तो मैं डिफॉल्ट वाइब्रेट और साउंड अलर्ट पाने की कोशिश कर रहा हूं, लेकिन अभी तक कोई किस्मत नहीं। मुझे लगता है कि यह कुछ ऐसा है जैसे मैं चूक को सेट करता हूं, लेकिन मैं इसे ठीक करने के तरीके के बारे में अनिश्चित हूं। कोई विचार?
public void connectedNotify() {
Integer mId = 0;
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_notify)
.setContentTitle("Device Connected")
.setContentText("Click to monitor");
Intent resultIntent = new Intent(this, MainActivity.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
stackBuilder.addParentStack(MainActivity.class);
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent =
PendingIntent.getActivity(getApplicationContext(),
0,
resultIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(resultPendingIntent);
mBuilder.setOngoing(true);
Notification note = mBuilder.build();
note.defaults |= Notification.DEFAULT_VIBRATE;
note.defaults |= Notification.DEFAULT_SOUND;
NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(mId, note);
}
android.permission.VIBRATEAndroidManifest.xml में गायब हैं ।