04-07-2016 01:43 PM
if ( keyCode == KeyEvent.KEYCODE_VOLUME_UP ){
if ( event.getAction() == KeyEvent.ACTION_DOWN ) {
//audioManager.getAudioManager().adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FLAG_PLAY_SOUND | AudioManager.FLAG_SHOW_UI);
audioManager.getAudioManager().setStreamVolume(AudioManager.STREAM_MUSIC, 14, 0);
Notification notification = new Notification.Builder(this)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setTicker("dffdfddfdf")
.setSubText("FDdff")
.setContentText("fdfddffdfdfd")
.setContentTitle("fdfdfddf")
.setContentInfo("eeeeee")
.setColor(Color.argb(1, 255,0 ,0))
.setWhen(System.currentTimeMillis())
.build();
NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
// mId allows you to update the notification later on.
mNotificationManager.notify(TAG, 0, notification);
}
04-10-2016 12:06 PM
04-12-2016 08:19 AM
04-13-2016 03:32 PM
06-22-2016 06:57 PM