Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AudioManager audioManager = (AudioManager) getContext().getSystemService(AUDIO_SERVICE);
- audioManager.setMode(AudioManager.ROUTE_EARPIECE);
- audioManager.setSpeakerphoneOn(false);
- NotificationCompat.Builder mBuilder =
- new NotificationCompat.Builder(context)
- .setSmallIcon(R.drawable.newlogo)
- .setLargeIcon(largeIcon)
- .setSound(uri)
- .setContentTitle(notificationHeading)
- .setContentText(notificationBody)
- .setPriority(Notification.PRIORITY_HIGH).setVibrate(v);
- notificationManager.notify(1,mBuilder.build());
- AUDIO_STREAM_ENFORCED_AUDIBLE = 7, /* Sounds that cannot be muted by user
- * and must be routed to speaker
- */
- AUDIO_STREAM_TTS = 9, /* Transmitted Through Speaker.
- * Plays over speaker only, silent on other devices.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement