changing the notification ringtone in android
I have implemented preference screen on own i.e., I have prepared custom
listview and managed all the things what my app needs on own. But I am
stuck how to give user a facility to change the notification ringtone.
Usually we can achieve this by RingtonePreferece.
But how to implement it without using preference screen, so that by
clicking on that list item it should redirect the user to list of
ringtones and when he selects that particular ringtone, the title of the
ringtone should be shown on that particular list row and has to be used as
ringtone for notification. Can someone please suggest on how to achieve
this? Below is my notification code.
NotificationCompat.Builder builder =
new NotificationCompat.Builder(context)
.setSmallIcon(R.drawable.ic_launcher)
.setTicker(msg)
.setContentTitle(title)
.setContentText(msg)
.setWhen(System.currentTimeMillis())
.setAutoCancel(true);
NotificationManager manager =
(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(id, builder.build());
No comments:
Post a Comment