Skip to content

Instantly share code, notes, and snippets.

@wasnot
Created July 8, 2015 05:19
Show Gist options
  • Save wasnot/60dbaa123726c6235e4c to your computer and use it in GitHub Desktop.
Save wasnot/60dbaa123726c6235e4c to your computer and use it in GitHub Desktop.
[Android][AppCompat]AppCompat22.2.0でv7.NotificationCompatが追加されてMediaStyleが使えるようになっていた ref: http://qiita.com/wasnot/items/1f687197f931c37cf496
new NotificationCompat.Builder(this).setStyle(new Notification.MediaStyle()
.setMediaSession(mySession))
Notification noti = new NotificationCompat.Builder()
.setSmallIcon(R.drawable.ic_stat_player)
.setContentTitle("Track title")
.setContentText("Artist - Album")
.setLargeIcon(albumArtBitmap))
.setStyle(new NotificationCompat.MediaStyle()
.setMediaSession(mySession))
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment